Skip to content

Commit

Permalink
fix: regression — additionalArgs is not passed to npm rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Nov 12, 2016
1 parent f31a20d commit 92ad554
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@ function computeExtraArgs(options: BuildMetadata) {
export function installDependencies(appDir: string, electronVersion: string, arch: string = process.arch, additionalArgs: Array<string>): Promise<any> {
log(`Installing app dependencies for arch ${arch} to ${appDir}`)
let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS
const npmExecArgs = ["install", "--production"]
const execArgs = ["install", "--production"]

const isYarn = isYarnPath(execPath)
if (!isYarn) {
if (process.env.NPM_NO_BIN_LINKS === "true") {
npmExecArgs.push("--no-bin-links")
execArgs.push("--no-bin-links")
}
npmExecArgs.push("--cache-min", "999999999")
execArgs.push("--cache-min", "999999999")
}

if (execPath == null) {
execPath = getPackageToolPath()
}
else {
npmExecArgs.unshift(execPath)
execArgs.unshift(execPath)
execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node"
}

for (let a of additionalArgs) {
if (!isYarn || a !== "--build-from-source") {
npmExecArgs.push(a)
execArgs.push(a)
}
}

return spawn(execPath, npmExecArgs, {
return spawn(execPath, execArgs, {
cwd: appDir,
env: getGypEnv(electronVersion, arch),
})
Expand Down Expand Up @@ -152,6 +152,7 @@ export async function rebuild(appDir: string, electronVersion: string, arch: str
}
else {
execArgs.push("rebuild")
execArgs.push(...additionalArgs)
execArgs.push(...nativeDeps.map(it => path.basename(it)))
await spawn(execPath, execArgs, {cwd: appDir, env: env})
}
Expand Down

0 comments on commit 92ad554

Please sign in to comment.