@@ -11,7 +11,6 @@ const Util = require("util");
11
11
const FS = require ( "fs" ) . promises ;
12
12
13
13
const { cmpTags} = require ( "tag-cmp" ) ;
14
- const exec = Util . promisify ( ChildProcess . exec ) ;
15
14
const execFile = Util . promisify ( ChildProcess . execFile ) ;
16
15
17
16
async function run ( ) {
@@ -362,44 +361,9 @@ async function installCrystalForWindows({crystal, arch = "x86_64", path}) {
362
361
await IO . mv ( await downloadCrystalNightlyForWindows ( ) , path ) ;
363
362
364
363
Core . info ( "Setting up environment for Crystal" ) ;
365
- const vars = await variablesForVCBuildTools ( ) ;
366
- for ( const [ k , v ] of vars . entries ( ) ) {
367
- Core . exportVariable ( k , v ) ;
368
- }
369
364
Core . addPath ( path ) ;
370
365
}
371
366
372
- const outputSep = "---" ;
373
- const vcvarsPath = String . raw `C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat` ;
374
-
375
- async function variablesForVCBuildTools ( ) {
376
- const command = `set && echo ${ outputSep } && "${ vcvarsPath } " >nul && set` ;
377
- Core . info ( `[command]cmd /c "${ command } "` ) ;
378
- const { stdout} = await exec ( command , { shell : "cmd" } ) ;
379
- Core . debug ( JSON . stringify ( stdout ) ) ;
380
- return new Map ( getChangedVars ( stdout . trimEnd ( ) . split ( / \r ? \n / ) ) ) ;
381
- }
382
-
383
- function * getChangedVars ( lines ) {
384
- const vars = new Map ( ) ;
385
- lines = lines [ Symbol . iterator ] ( ) ;
386
- for ( const line of lines ) {
387
- if ( line . trimEnd ( ) === outputSep ) {
388
- break ;
389
- }
390
- const [ key , value ] = line . split ( / = ( .+ ) / , 2 ) ;
391
- vars . set ( key . toLowerCase ( ) , value ) ;
392
- }
393
- for ( const line of lines ) {
394
- const [ key , value ] = line . split ( / = ( .+ ) / , 2 ) ;
395
- if ( vars . get ( key . toLowerCase ( ) ) !== value ) {
396
- yield [ key , value ] ;
397
- } else {
398
- Core . debug ( "Unchanged: " + key ) ;
399
- }
400
- }
401
- }
402
-
403
367
async function downloadCrystalNightlyForWindows ( ) {
404
368
Core . info ( "Looking for latest Crystal build" ) ;
405
369
0 commit comments