Skip to content

Commit ba1cd4b

Browse files
committed
feat: initial yarn support (avoid --cache-min)
Closes #861
1 parent a3bba92 commit ba1cd4b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/util.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ export function getGypEnv(electronVersion: string, arch: string): any {
3434

3535
export function spawnNpmProduction(command: string, appDir: string, forceBuildFromSource: boolean, env?: any): Promise<any> {
3636
let npmExecPath = process.env.npm_execpath || process.env.NPM_CLI_JS
37-
const npmExecArgs = [command, "--production", "--cache-min", "999999999"]
37+
const npmExecArgs = [command, "--production"]
38+
39+
if (npmExecPath == null || !npmExecPath.includes("yarn")) {
40+
npmExecArgs.push("--cache-min", "999999999")
41+
}
42+
3843
if (npmExecPath == null) {
3944
npmExecPath = process.platform === "win32" ? "npm.cmd" : "npm"
4045
}

0 commit comments

Comments
 (0)