Skip to content

Commit 5a557a4

Browse files
committed
Avoid usage of Bare.exit()
1 parent 0163737 commit 5a557a4

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

scripts/make.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@ const child = spawn(
3939
)
4040

4141
child.on('exit', (code, signal) => {
42-
if (signal) return Bare.exit(128 + signal)
43-
if (code !== 0) return Bare.exit(code)
42+
Bare.exitCode = signal ? 128 + signal : code
43+
if (code === 0 && !signal) {
44+
const src = path.join(out, bin)
45+
const ext = isWindows ? '.exe' : ''
46+
const dest = path.join('out', 'make', `pear-${host}${ext}`)
4447

45-
const src = path.join(out, bin)
46-
const ext = isWindows ? '.exe' : ''
47-
const dest = path.join('out', 'make', `pear-${host}${ext}`)
48-
49-
fs.mkdirSync(path.dirname(dest), { recursive: true })
50-
fs.copyFileSync(src, dest)
51-
fs.chmodSync(dest, 0o755)
52-
53-
console.log(`wrote ${dest}`)
48+
fs.mkdirSync(path.dirname(dest), { recursive: true })
49+
fs.copyFileSync(src, dest)
50+
fs.chmodSync(dest, 0o755)
51+
}
5452
})

0 commit comments

Comments
 (0)