File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -116,14 +116,18 @@ function main() {
116
116
const vcvars = `"${ findVcvarsall ( ) } " ${ args . join ( ' ' ) } `
117
117
core . debug ( `vcvars command-line: ${ vcvars } ` )
118
118
119
- const old_environment = child_process . execSync ( `set` , { shell : "cmd" } ) . toString ( ) . split ( '\r\n' )
120
- const new_environment = child_process . execSync ( `${ vcvars } && set` , { shell : "cmd" } ) . toString ( ) . split ( '\r\n' )
119
+ const cmd_output_string = child_process . execSync ( `set && cls && ${ vcvars } && cls && set` , { shell : "cmd" } ) . toString ( )
120
+ const cmd_output_parts = cmd_output_string . split ( '\f' )
121
+
122
+ const old_environment = cmd_output_parts [ 0 ] . split ( '\r\n' )
123
+ const vcvars_output = cmd_output_parts [ 1 ] . split ( '\r\n' )
124
+ const new_environment = cmd_output_parts [ 2 ] . split ( '\r\n' )
121
125
122
126
// If vsvars.bat is given an incorrect command line, it will print out
123
127
// an error and *still* exit successfully. Parse out errors from output
124
128
// which don't look like environment variables, and fail if appropriate.
125
129
var failed = false
126
- for ( let line of new_environment ) {
130
+ for ( let line of vcvars_output ) {
127
131
if ( line . match ( / ^ \[ E R R O R .* \] / ) ) {
128
132
failed = true
129
133
// Don't print this particular line which will be confusing in output.
You can’t perform that action at this time.
0 commit comments