File tree 3 files changed +5
-14
lines changed
3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,7 @@ function getElectron(arch) {
98
98
. pipe ( vfs . dest ( '.build/electron' ) ) ;
99
99
} ;
100
100
}
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 ) {
105
102
const version = getElectronVersion ( ) ;
106
103
const electronPath = path . join ( root , '.build' , 'electron' ) ;
107
104
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 {
107
107
} ;
108
108
}
109
109
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 > {
114
111
const version = getElectronVersion ( ) ;
115
112
const electronPath = path . join ( root , '.build' , 'electron' ) ;
116
113
const versionFile = path . join ( electronPath , 'version' ) ;
Original file line number Diff line number Diff line change @@ -23,17 +23,14 @@ function yarnInstall(location, opts) {
23
23
const args = original . filter ( arg => arg === '--ignore-optional' || arg === '--frozen-lockfile' ) ;
24
24
25
25
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
29
28
// against node, which is not consistently supported on Windows on Arm
30
29
// (yet).
31
- process . env [ " npm_config_arch" ] = "ia32"
30
+ opts . npm_config_arch = "ia32"
32
31
}
33
32
console . log ( `$ yarn ${ args . join ( ' ' ) } ` ) ;
34
33
const result = cp . spawnSync ( yarn , args , opts ) ;
35
- // Restore the architecture, if temporarily swapped.
36
- process . env [ "npm_config_arch" ] = oldConfigArch
37
34
if ( result . error || result . status !== 0 ) {
38
35
process . exit ( 1 ) ;
39
36
}
You can’t perform that action at this time.
0 commit comments