@@ -396,15 +396,17 @@ win.getOSBits = function getOSBits() {
396396
397397function tryVS7 ( hostBits , target_arch ) {
398398 try {
399- const psFile = path . join ( __dirname , '..' , '..' , '..' , 'tools' , 'Get-VSConfig.ps1' ) ;
399+ const psFile = path . join ( __dirname ,
400+ '..' , '..' , '..' , 'tools' , 'Get-VSConfig.ps1' ) ;
400401 const vsSetupRaw = gyp . bindings . execSync ( `powershell ${ psFile } ` ) . toString ( ) ;
401402 if ( ! vsSetupRaw ) return ;
402403 const vsSetup = vsSetupRaw . split ( / [ \r | \n ] / g) . reduce ( ( s , l ) => {
403404 const lParts = l . split ( ': ' ) ;
404405 if ( lParts . length > 1 ) s [ lParts [ 0 ] ] = lParts [ 1 ] ;
405406 return s ;
406407 } , { } ) ;
407- const VsDevCmd = path . join ( vsSetup . InstallationPath , 'Common7' , 'Tools' , 'VsDevCmd.bat' ) ;
408+ const VsDevCmd = path . join ( vsSetup . InstallationPath ,
409+ 'Common7' , 'Tools' , 'VsDevCmd.bat' ) ;
408410 const argArch = target_arch === 'x64' ? 'amd64' : 'x86' ;
409411 const argHost = hostBits === 64 ? 'amd64' : 'x86' ;
410412 return `${ VsDevCmd } -arch=${ argArch } -host_arch=${ argHost } -no_logo` ;
@@ -446,7 +448,9 @@ function findOldVcVarsFile(hostBits, target_arch) {
446448 if ( hostBits === 64 )
447449 vcEnvCmd = '"' + path . join ( tools , 'VC' , 'vcvarsall.bat' ) + '" amd64_x86' ;
448450 else
449- vcEnvCmd = '"' + path . join ( tools , 'Common7' , 'Tools' , 'vsvars32.bat' ) + '"' ;
451+ vcEnvCmd = '"'
452+ + path . join ( tools , 'Common7' , 'Tools' , 'vsvars32.bat' )
453+ + '"' ;
450454 } else if ( target_arch === 'x64' ) {
451455 let arg ;
452456 if ( hostBits === 64 )
@@ -463,8 +467,8 @@ function findOldVcVarsFile(hostBits, target_arch) {
463467win . resolveDevEnvironment = function resolveDevEnvironment ( target_arch ) {
464468 const hostBits = win . getOSBits ( ) ;
465469
466- const vcEnvCmd = tryVS7 ( hostBits , target_arch )
467- || findOldVcVarsFile ( hostBits , target_arch ) ;
470+ const vcEnvCmd = tryVS7 ( hostBits , target_arch ) ||
471+ findOldVcVarsFile ( hostBits , target_arch ) ;
468472 let lines = [ ] ;
469473 try {
470474 lines = gyp . bindings . execSync ( `${ vcEnvCmd } & set` , { env : { } } ) . toString ( )
@@ -481,8 +485,8 @@ win.resolveDevEnvironment = function resolveDevEnvironment(target_arch) {
481485 return env ;
482486} ;
483487
484- const IMPORTANT_VARS =
485- / ^ i n c l u d e | l i b | l i b p a t h | p a t h | p a t h e x t | s y s t e m r o o t | t e m p | t m p $ / i;
488+ // const IMPORTANT_VARS =
489+ // /^include|lib|libpath|path|pathext|systemroot|temp|tmp$/i;
486490
487491win . genEnvironment = function genEnvironment ( outDir , target_arch ) {
488492 const env = win . resolveDevEnvironment ( target_arch ) ;
0 commit comments