Skip to content

Commit c7f5c70

Browse files
authoredJul 19, 2024
chore(build): fix build error on Windows (#11389)
1 parent fd5c001 commit c7f5c70

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎scripts/utils.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ export function fuzzyMatchTarget(partialTargets, includeAllMatching) {
6060
*/
6161
export async function exec(command, args, options) {
6262
return new Promise((resolve, reject) => {
63-
const process = spawn(command, args, {
63+
const _process = spawn(command, args, {
6464
stdio: [
6565
'ignore', // stdin
6666
'pipe', // stdout
6767
'pipe', // stderr
6868
],
6969
...options,
70+
shell: process.platform === 'win32',
7071
})
7172

7273
/**
@@ -78,19 +79,19 @@ export async function exec(command, args, options) {
7879
*/
7980
const stdoutChunks = []
8081

81-
process.stderr?.on('data', chunk => {
82+
_process.stderr?.on('data', chunk => {
8283
stderrChunks.push(chunk)
8384
})
8485

85-
process.stdout?.on('data', chunk => {
86+
_process.stdout?.on('data', chunk => {
8687
stdoutChunks.push(chunk)
8788
})
8889

89-
process.on('error', error => {
90+
_process.on('error', error => {
9091
reject(error)
9192
})
9293

93-
process.on('exit', code => {
94+
_process.on('exit', code => {
9495
const ok = code === 0
9596
const stderr = Buffer.concat(stderrChunks).toString().trim()
9697
const stdout = Buffer.concat(stdoutChunks).toString().trim()

0 commit comments

Comments
 (0)