mirror of
https://github.com/alex8088/electron-vite.git
synced 2026-11-23 08:43:33 +08:00
Merge c1b36fa845c4257cba55203b3770e8727bf29dd7 into ac2cdd1a21dfff65d4454899aac20d1232174ada
This commit is contained in:
commit
d20c8f0d82
@ -159,7 +159,10 @@ export function startElectron(root: string | undefined): ChildProcess {
|
||||
const entry = process.env.ELECTRON_ENTRY || '.'
|
||||
|
||||
const ps = spawn(electronPath, [entry].concat(args), { stdio: 'inherit' })
|
||||
ps.on('close', process.exit)
|
||||
// `code` is null when the child was terminated by a signal, and `process.exit` ignores
|
||||
// its second argument, so passing the listener directly would report every crash as a
|
||||
// successful exit. Map a signal death to a non-zero status instead.
|
||||
ps.on('close', (code, signal) => process.exit(code ?? (signal ? 1 : 0)))
|
||||
|
||||
return ps
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user