Skip to content

Commit

Permalink
fix(packager): throw error when electron-prebuilt-compile is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
malept authored and MarshallOfSound committed Dec 4, 2016
1 parent 9f4c0b4 commit 2344995
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/util/resolve-dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2344995

Please sign in to comment.