Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ module.exports = {
baseURL: 'https://selenium-release.storage.googleapis.com'
},
firefox: {
version: '0.26.0',
version: '0.28.0',
arch: process.arch,
baseURL: 'https://github.com/mozilla/geckodriver/releases/download'
},
edge: {
version: '17134'
},
chromiumedge: {
version: '86.0.600.0',
version: '86.0.622.69',
arch: process.arch,
baseURL: 'https://msedgedriver.azureedge.net'
}
Expand Down
32 changes: 13 additions & 19 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,6 @@ function install(opts, cb) {
debug("unzip " + zipFilePath);

var yauzl = require("yauzl");
var extractPath = path.join(
path.dirname(zipFilePath),
path.basename(zipFilePath, ".zip")
);

yauzl.open(zipFilePath, function onOpenZipFile(err, zipFile) {
if (err) {
Expand All @@ -458,14 +454,18 @@ function install(opts, cb) {
if (/.*\/.*/.test(entry.fileName)) {
return; // ignore folders, i.e. release notes folder in edge driver zip
}
zipFile.openReadStream(entry, function onOpenZipFileEntryReadStream(
zipFile.openReadStream(entry, { autoClose: true }, function onOpenZipFileEntryReadStream(
err,
readStream
) {
if (err) {
cb(err);
return;
}
var extractPath = path.join(
path.dirname(zipFilePath),
isBrowserDriver(entry.fileName) ? path.basename(zipFilePath, ".zip") : entry.fileName
);
var extractWriteStream = fs
.createWriteStream(extractPath)
.once(
Expand All @@ -478,12 +478,11 @@ function install(opts, cb) {
"error",
cb.bind(null, new Error("Could not read " + zipFilePath))
)
.once("finish", function onExtracted() {
zipFile.close();
cb();
});
});
});
zipFile.on('close', () => {
cb();
})
});
}

Expand Down Expand Up @@ -580,16 +579,6 @@ function checksum(filepath, cb) {
.once("error", cb);
}

function unquote(str, quoteChar) {
quoteChar = quoteChar || '"';

if (str[0] === quoteChar && str[str.length - 1] === quoteChar) {
return str.slice(1, str.length - 1);
}

return str;
}

function isUpToDate(url, requestOpts, hash, cb) {
if (!hash) {
return cb(null, false);
Expand Down Expand Up @@ -626,3 +615,8 @@ function isUpToDate(url, requestOpts, hash, cb) {
cb(new Error("Could not request headers from " + url + ": " + err));
});
}

const isBrowserDriver = (fileName) => {
const extensions = [".exe"]
return extensions.some(ext => fileName.endsWith(ext)) || !fileName.includes(".")
}