Skip to content

Commit 92ad554

Browse files
committed
fix: regression — additionalArgs is not passed to npm rebuild
1 parent f31a20d commit 92ad554

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/yarn.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,31 @@ function computeExtraArgs(options: BuildMetadata) {
3838
export function installDependencies(appDir: string, electronVersion: string, arch: string = process.arch, additionalArgs: Array<string>): Promise<any> {
3939
log(`Installing app dependencies for arch ${arch} to ${appDir}`)
4040
let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS
41-
const npmExecArgs = ["install", "--production"]
41+
const execArgs = ["install", "--production"]
4242

4343
const isYarn = isYarnPath(execPath)
4444
if (!isYarn) {
4545
if (process.env.NPM_NO_BIN_LINKS === "true") {
46-
npmExecArgs.push("--no-bin-links")
46+
execArgs.push("--no-bin-links")
4747
}
48-
npmExecArgs.push("--cache-min", "999999999")
48+
execArgs.push("--cache-min", "999999999")
4949
}
5050

5151
if (execPath == null) {
5252
execPath = getPackageToolPath()
5353
}
5454
else {
55-
npmExecArgs.unshift(execPath)
55+
execArgs.unshift(execPath)
5656
execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node"
5757
}
5858

5959
for (let a of additionalArgs) {
6060
if (!isYarn || a !== "--build-from-source") {
61-
npmExecArgs.push(a)
61+
execArgs.push(a)
6262
}
6363
}
6464

65-
return spawn(execPath, npmExecArgs, {
65+
return spawn(execPath, execArgs, {
6666
cwd: appDir,
6767
env: getGypEnv(electronVersion, arch),
6868
})
@@ -152,6 +152,7 @@ export async function rebuild(appDir: string, electronVersion: string, arch: str
152152
}
153153
else {
154154
execArgs.push("rebuild")
155+
execArgs.push(...additionalArgs)
155156
execArgs.push(...nativeDeps.map(it => path.basename(it)))
156157
await spawn(execPath, execArgs, {cwd: appDir, env: env})
157158
}

0 commit comments

Comments
 (0)