@@ -16,8 +16,8 @@ export const debug7z = debugFactory("electron-builder:7z")
1616
1717const DEFAULT_APP_DIR_NAMES = [ "app" , "www" ]
1818
19- export function installDependencies ( appDir : string , electronVersion : string , arch : string = process . arch , command : string = "install" , fromSource : boolean = true ) : BluebirdPromise < any > {
20- return task ( `${ ( command === "install" ? "Installing" : "Rebuilding" ) } app dependencies for arch ${ arch } to ${ appDir } ` , spawnNpmProduction ( command , appDir , getGypEnv ( electronVersion , arch ) , fromSource ) )
19+ export function installDependencies ( appDir : string , electronVersion : string , arch : string = process . arch , forceBuildFromSource : boolean , command : string = "install" ) : BluebirdPromise < any > {
20+ return task ( `${ ( command === "install" ? "Installing" : "Rebuilding" ) } app dependencies for arch ${ arch } to ${ appDir } ` , spawnNpmProduction ( command , appDir , forceBuildFromSource , getGypEnv ( electronVersion , arch ) ) )
2121}
2222
2323export function getGypEnv ( electronVersion : string , arch : string ) : any {
@@ -32,17 +32,17 @@ export function getGypEnv(electronVersion: string, arch: string): any {
3232 } )
3333}
3434
35- export function spawnNpmProduction ( command : string , appDir : string , env ?: any , forceBuild : boolean = true ) : BluebirdPromise < any > {
35+ export function spawnNpmProduction ( command : string , appDir : string , forceBuildFromSource : boolean , env ?: any ) : BluebirdPromise < any > {
3636 let npmExecPath = process . env . npm_execpath || process . env . NPM_CLI_JS
37- let npmExecArgs = [ command , "--production" , "--cache-min" , "999999999" ]
37+ const npmExecArgs = [ command , "--production" , "--cache-min" , "999999999" ]
3838 if ( npmExecPath == null ) {
3939 npmExecPath = process . platform === "win32" ? "npm.cmd" : "npm"
4040 }
4141 else {
4242 npmExecArgs . unshift ( npmExecPath )
4343 npmExecPath = process . env . npm_node_execpath || process . env . NODE_EXE || "node"
4444 }
45- if ( forceBuild ) {
45+ if ( forceBuildFromSource ) {
4646 npmExecArgs . push ( "--build-from-source" )
4747 }
4848
0 commit comments