Skip to content

Commit

Permalink
feat(core): add platform and arch to generateAssets hook parame…
Browse files Browse the repository at this point in the history
…ters (#2327)

* Support WSL
  • Loading branch information
timfish committed Jul 11, 2021
1 parent c7eff26 commit e3af089
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/api/core/src/api/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default async ({
throw new Error('config.forge.packagerConfig.prebuiltAsar is not supported by Electron Forge');
}

await runHook(forgeConfig, 'generateAssets');
await runHook(forgeConfig, 'generateAssets', platform, arch);
await runHook(forgeConfig, 'prePackage');

d('packaging with options', packageOpts);
Expand Down
9 changes: 6 additions & 3 deletions packages/api/core/src/api/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ export default async ({
throw new Error(`Please set your application's 'version' in '${dir}/package.json'.`);
}

const platform = process.env.npm_config_platform || process.platform;
const arch = process.env.npm_config_arch || process.arch;

await rebuild(
dir,
await getElectronVersion(dir, packageJSON),
process.platform as ForgePlatform,
process.arch as ForgeArch,
platform as ForgePlatform,
arch as ForgeArch,
forgeConfig.electronRebuildConfig,
);

await runHook(forgeConfig, 'generateAssets');
await runHook(forgeConfig, 'generateAssets', platform, arch);

let lastSpawned: ElectronProcess | null = null;

Expand Down

0 comments on commit e3af089

Please sign in to comment.