@@ -60,13 +60,14 @@ export function fuzzyMatchTarget(partialTargets, includeAllMatching) {
60
60
*/
61
61
export async function exec ( command , args , options ) {
62
62
return new Promise ( ( resolve , reject ) => {
63
- const process = spawn ( command , args , {
63
+ const _process = spawn ( command , args , {
64
64
stdio : [
65
65
'ignore' , // stdin
66
66
'pipe' , // stdout
67
67
'pipe' , // stderr
68
68
] ,
69
69
...options ,
70
+ shell : process . platform === 'win32' ,
70
71
} )
71
72
72
73
/**
@@ -78,19 +79,19 @@ export async function exec(command, args, options) {
78
79
*/
79
80
const stdoutChunks = [ ]
80
81
81
- process . stderr ?. on ( 'data' , chunk => {
82
+ _process . stderr ?. on ( 'data' , chunk => {
82
83
stderrChunks . push ( chunk )
83
84
} )
84
85
85
- process . stdout ?. on ( 'data' , chunk => {
86
+ _process . stdout ?. on ( 'data' , chunk => {
86
87
stdoutChunks . push ( chunk )
87
88
} )
88
89
89
- process . on ( 'error' , error => {
90
+ _process . on ( 'error' , error => {
90
91
reject ( error )
91
92
} )
92
93
93
- process . on ( 'exit' , code => {
94
+ _process . on ( 'exit' , code => {
94
95
const ok = code === 0
95
96
const stderr = Buffer . concat ( stderrChunks ) . toString ( ) . trim ( )
96
97
const stdout = Buffer . concat ( stdoutChunks ) . toString ( ) . trim ( )
0 commit comments