Skip to content

Commit

Permalink
fix(alias): fix the forge alias so that it can run the make command
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored and malept committed Jan 15, 2017
1 parent b678333 commit 725e6b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ gulp.task('link', () => {

if (packageJSON.bin[binName] === packageJSON.bin['electron-forge']) {
files.forEach((fileName) => {
fs.writeFileSync(path.resolve(__dirname, `./dist/${fileName.replace('electron-forge', binName)}`), `require('./${fileName}');`);
fs.writeFileSync(
path.resolve(__dirname, `./dist/${fileName.replace('electron-forge', binName)}`),
`/* Auto-generated bin alias file */\nglobal.__LINKED_FORGE__ = true;\nrequire('./${fileName}');\n`
);
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/electron-forge-make.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getMakeOptions = () => {
return makeOpts;
};

if (process.mainModule === module) {
if (process.mainModule === module || global.__LINKED_FORGE__) {
(async () => {
const makeOpts = getMakeOptions();

Expand Down

0 comments on commit 725e6b0

Please sign in to comment.