File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed
Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,7 @@ function getElectron(arch) {
9898 . pipe ( vfs . dest ( '.build/electron' ) ) ;
9999 } ;
100100}
101- async function main ( arch = process . arch ) {
102- if ( process . env [ "npm_config_arch" ] ) {
103- arch = process . env [ "npm_config_arch" ] ;
104- }
101+ async function main ( arch = process . env [ "npm_config_arch" ] || process . arch ) {
105102 const version = getElectronVersion ( ) ;
106103 const electronPath = path . join ( root , '.build' , 'electron' ) ;
107104 const versionFile = path . join ( electronPath , 'version' ) ;
Original file line number Diff line number Diff line change @@ -107,10 +107,7 @@ function getElectron(arch: string): () => NodeJS.ReadWriteStream {
107107 } ;
108108}
109109
110- async function main ( arch = process . arch ) : Promise < void > {
111- if ( process . env [ "npm_config_arch" ] ) {
112- arch = process . env [ "npm_config_arch" ] as string ;
113- }
110+ async function main ( arch = process . env [ "npm_config_arch" ] || process . arch ) : Promise < void > {
114111 const version = getElectronVersion ( ) ;
115112 const electronPath = path . join ( root , '.build' , 'electron' ) ;
116113 const versionFile = path . join ( electronPath , 'version' ) ;
Original file line number Diff line number Diff line change @@ -23,17 +23,14 @@ function yarnInstall(location, opts) {
2323 const args = original . filter ( arg => arg === '--ignore-optional' || arg === '--frozen-lockfile' ) ;
2424
2525 console . log ( `Installing dependencies in ${ location } ...` ) ;
26- const oldConfigArch = process . env [ 'npm_config_arch' ]
27- if ( location . startsWith ( "remote" ) && oldConfigArch == "arm64" ) {
28- // Temporarily set remote arch to x86, because remote portion builds
26+ if ( location . startsWith ( "remote" ) && process . env [ "npm_config_arch" ] == "arm64" ) {
27+ // Temporarily set remote arch to x86, because the remote portion builds
2928 // against node, which is not consistently supported on Windows on Arm
3029 // (yet).
31- process . env [ " npm_config_arch" ] = "ia32"
30+ opts . npm_config_arch = "ia32"
3231 }
3332 console . log ( `$ yarn ${ args . join ( ' ' ) } ` ) ;
3433 const result = cp . spawnSync ( yarn , args , opts ) ;
35- // Restore the architecture, if temporarily swapped.
36- process . env [ "npm_config_arch" ] = oldConfigArch
3734 if ( result . error || result . status !== 0 ) {
3835 process . exit ( 1 ) ;
3936 }
You can’t perform that action at this time.
0 commit comments