Skip to content

Commit 2908c74

Browse files
committed
fix(generator): fails if electron prompt not shown
Now will check for existing electron version when calculating spectron version
1 parent 9ee45b1 commit 2908c74

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

generator/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ module.exports = (api, options = {}) => {
113113
if (testFramework) {
114114
// Spectron version should be electron version + 2
115115
devDependencies.spectron =
116-
'^' + (parseInt(electronVersion.match(/^\^(\d*)\./)[1]) + 2) + '.0.0'
116+
'^' +
117+
(parseInt(
118+
(electronVersion || pkg.devDependencies.electron).match(/^\^(\d*)\./)[1]
119+
) +
120+
2) +
121+
'.0.0'
117122
}
118123
if (testFramework === 'mocha') {
119124
dependencies['chai-as-promised'] = '^7.1.1'

0 commit comments

Comments
 (0)