Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to specify additional npm rebuild args #881

Merged
merged 2 commits into from
Nov 5, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: code style on npmArgs
mmckegg committed Nov 5, 2016
commit 5cd13e63c37f4eb9117ce22934fd26ff1ff6204c
3 changes: 1 addition & 2 deletions src/packager.ts
Original file line number Diff line number Diff line change
@@ -237,12 +237,11 @@ export class Packager implements BuildInfo {
}
else {
const forceBuildFromSource = this.devMetadata.build.npmSkipBuildFromSource !== true
const additionalArgs = this.devMetadata.build.npmArgs
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", additionalArgs)
await installDependencies(this.appDir, this.electronVersion, Arch[arch], forceBuildFromSource, (await statOrNull(path.join(this.appDir, "node_modules"))) == null ? "install" : "rebuild", this.devMetadata.build.npmArgs)
}
}
}
5 changes: 3 additions & 2 deletions src/util/util.ts
Original file line number Diff line number Diff line change
@@ -56,8 +56,9 @@ export function spawnNpmProduction(command: string, appDir: string, forceBuildFr

if (additionalArgs) {
if (Array.isArray(additionalArgs)) {
additionalArgs.forEach(arg => npmExecArgs.push(arg))
} else {
additionalArgs.push(...additionalArgs)
}
else {
additionalArgs.push(additionalArgs)
}
}