Skip to content

Commit 9e6302f

Browse files
author
steven nguyen
committed
fix/deps: min versions of electron-chromedriver...
... and electron-snapshot to the current electron version (v11)
1 parent 07edc2b commit 9e6302f

File tree

3 files changed

+83
-106
lines changed

3 files changed

+83
-106
lines changed

script/lib/check-chromedriver-version.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ const semver = require('semver');
55
const chromedriverMetadataPath = require('electron-chromedriver/package.json');
66
const mksnapshotMetadataPath = require('electron-mksnapshot/package.json');
77

8+
// The enviroment variable is usually set in install-script-dependencies.js
9+
const majorElectronVersion = semver.major(
10+
process.env.ELECTRON_CUSTOM_VERSION ||
11+
require('../config').appMetadata.electronVersion
12+
);
13+
814
module.exports = function() {
915
// Chromedriver should be at least v9.0.0
1016
// Mksnapshot should be at least v9.0.2
@@ -26,15 +32,15 @@ module.exports = function() {
2632
);
2733
}
2834

29-
if (!semver.satisfies(chromedriverActualVer, '>=9.0.0')) {
35+
if (!semver.satisfies(chromedriverActualVer, `>=${majorElectronVersion}`)) {
3036
throw new Error(
31-
`electron-chromedriver should be at least v9.0.0 to support the ELECTRON_CUSTOM_VERSION environment variable.`
37+
`electron-chromedriver should be at least v${majorElectronVersion} to support the ELECTRON_CUSTOM_VERSION environment variable.`
3238
);
3339
}
3440

35-
if (!semver.satisfies(mksnapshotActualVer, '>=9.0.2')) {
41+
if (!semver.satisfies(mksnapshotActualVer, `>=${majorElectronVersion}`)) {
3642
throw new Error(
37-
`electron-mksnapshot should be at least v9.0.2 to support the ELECTRON_CUSTOM_VERSION environment variable.`
43+
`electron-mksnapshot should be at least v${majorElectronVersion} to support the ELECTRON_CUSTOM_VERSION environment variable.`
3844
);
3945
}
4046
};

script/package-lock.json

Lines changed: 70 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)