diff --git a/forge.config.js b/forge.config.js index 2d50e349d..82bda28eb 100644 --- a/forge.config.js +++ b/forge.config.js @@ -145,6 +145,26 @@ let config = { }, packageAfterPrune: async (forgeConfig, buildPath, electronVersion, platform, arch) => { // Workaround from https://www.update.rocks/blog/fixing-the-python3/ + + const npmInstall = spawnSync("npm", ["install", "--omit=dev"], { + cwd: buildPath, + stdio: "inherit", + shell: true, + }); + + console.log(buildPath); + + // Clear out prebuilds for other architectures + // 1) we don't need them + // 2) windows binary signing tool blows up when it tries to sign them. + + const prebuilds = glob.GlobSync(`${buildPath}/**/prebuilds/*`); + const matchString = new RegExp(`prebuilds/${platform}`); + prebuilds.found.forEach(function(path) { + if (! path.match(matchString)) { + fs.rmdirSync(path, { recursive: true }); + } + }); if (platform === 'darwin') { console.log("We need to remove the problematic link file on macOS"); console.log(`Build path ${buildPath}`); @@ -178,26 +198,6 @@ if (platform === 'darwin') { } } - - const npmInstall = spawnSync("npm", ["install", "--omit=dev"], { - cwd: buildPath, - stdio: "inherit", - shell: true, - }); - - console.log(buildPath); - - // Clear out prebuilds for other architectures - // 1) we don't need them - // 2) windows binary signing tool blows up when it tries to sign them. - - const prebuilds = glob.GlobSync(`${buildPath}/**/prebuilds/*`); - const matchString = new RegExp(`prebuilds/${platform}`); - prebuilds.found.forEach(function(path) { - if (! path.match(matchString)) { - fs.rmdirSync(path, { recursive: true }); - } - }); }, } };