Skip to content

Commit

Permalink
fix(core): wait for overrideStartLogic before attempting to resolve t…
Browse files Browse the repository at this point in the history
…he location of the Electron mod

ISSUES CLOSED: 531
  • Loading branch information
MarshallOfSound committed Jul 13, 2018
1 parent 91ede6f commit 7e74206
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/api/core/src/api/start.ts
Expand Up @@ -57,7 +57,7 @@ export default async ({
};

const forgeSpawn = async () => {
let electronExecPath = require(path.resolve(dir, 'node_modules/electron'));
let electronExecPath: string | null = null;

// If a plugin has taken over the start command let's stop here
const spawnedPluginChild = await forgeConfig.pluginInterface.overrideStartLogic({
Expand All @@ -80,6 +80,10 @@ export default async ({
return spawnedPluginChild;
}

if (!electronExecPath) {
electronExecPath = require(path.resolve(dir, 'node_modules/electron'));
}

const spawnOpts = {
cwd: dir,
stdio: 'inherit',
Expand Down

0 comments on commit 7e74206

Please sign in to comment.