Skip to content

Commit e38c3db

Browse files
committed
debug compilation failure
1 parent a0f6007 commit e38c3db

1 file changed

Lines changed: 24 additions & 18 deletions

File tree

.github/actions/find/bootstrap.js

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,30 @@ import {spawn} from 'node:child_process'
77

88
function spawnPromisified(command, args, {quiet = false, ...options} = {}) {
99
return new Promise((resolve, reject) => {
10-
const proc = spawn(command, args, options)
11-
proc.stdout.setEncoding('utf8')
12-
proc.stdout.on('data', data => {
13-
if (!quiet) {
14-
console.log(data)
15-
}
16-
})
17-
proc.stderr.setEncoding('utf8')
18-
proc.stderr.on('data', data => {
19-
console.error(data)
20-
})
21-
proc.on('close', code => {
22-
if (code !== 0) {
23-
reject(code)
24-
} else {
25-
resolve(code)
26-
}
27-
})
10+
try {
11+
const proc = spawn(command, args, options)
12+
proc.stdout.setEncoding('utf8')
13+
proc.stdout.on('data', data => {
14+
if (!quiet) {
15+
console.log(data)
16+
}
17+
})
18+
proc.stderr.setEncoding('utf8')
19+
proc.stderr.on('data', data => {
20+
console.log('error on read data', data)
21+
console.error(data)
22+
})
23+
proc.on('close', code => {
24+
if (code !== 0) {
25+
reject(code)
26+
} else {
27+
resolve(code)
28+
}
29+
})
30+
} catch (error) {
31+
console.log('error on catch: ', error)
32+
reject(error)
33+
}
2834
})
2935
}
3036

0 commit comments

Comments
 (0)