From 81c6bdf52d36e6f38d91408c4a87907897c995d8 Mon Sep 17 00:00:00 2001 From: Alex Revin Date: Mon, 24 Oct 2016 09:32:26 +0200 Subject: [PATCH] feat: handle available native deps when building on non-native platforms Closes #842 --- src/packager.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/packager.ts b/src/packager.ts index 9c3c1e4762c..43fef261ec9 100644 --- a/src/packager.ts +++ b/src/packager.ts @@ -231,12 +231,14 @@ export class Packager implements BuildInfo { if (this.devMetadata.build.npmRebuild === false) { log("Skip app dependencies rebuild because npmRebuild is set to false") } - else if (platform.nodeName === process.platform) { - const forceBuildFromSource = this.devMetadata.build.npmSkipBuildFromSource !== true - await installDependencies(this.appDir, this.electronVersion, Arch[arch], forceBuildFromSource, (await statOrNull(path.join(this.appDir, "node_modules"))) == null ? "install" : "rebuild") - } else { - log("Skip app dependencies rebuild because platform is different") + const forceBuildFromSource = this.devMetadata.build.npmSkipBuildFromSource !== true + if (platform.nodeName !== process.platform && forceBuildFromSource) { + log("Skip app dependencies rebuild because platform is different") + } + else { + await installDependencies(this.appDir, this.electronVersion, Arch[arch], forceBuildFromSource, (await statOrNull(path.join(this.appDir, "node_modules"))) == null ? "install" : "rebuild") + } } } else {