Skip to content
Permalink
Browse files

fix(packager): throw error when electron-prebuilt-compile is not found

  • Loading branch information
malept authored and MarshallOfSound committed Dec 4, 2016
1 parent 9f4c0b4 commit 23449956f01b175aea2d2080fb4fd3e99bddc2c7
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/util/resolve-dir.js
@@ -14,9 +14,13 @@ export default async (dir) => {
if (await fs.exists(testPath)) {
const packageJSON = JSON.parse(await fs.readFile(testPath, 'utf8'));

if (packageJSON.devDependencies && packageJSON.devDependencies['electron-prebuilt-compile']
&& !/[0-9]/.test(packageJSON.devDependencies['electron-prebuilt-compile'][0])) {
global._resolveError = () => console.error('You must depend on an EXACT version of "electron-prebuilt-compile" not a range'.red);
if (packageJSON.devDependencies && packageJSON.devDependencies['electron-prebuilt-compile']) {
if (!/[0-9]/.test(packageJSON.devDependencies['electron-prebuilt-compile'][0])) {
global._resolveError = () => console.error('You must depend on an EXACT version of "electron-prebuilt-compile" not a range'.red);
return null;
}
} else {
global._resolveError = () => console.error('You must depend on "electron-prebuilt-compile" in your devDependencies'.red);
return null;
}

0 comments on commit 2344995

Please sign in to comment.
You can’t perform that action at this time.