Proxy child exit code when exiting parent process
This fixes code-server exiting with zero on errors.
This commit is contained in:
parent
ea36345d2c
commit
422503ef98
|
@ -204,6 +204,7 @@ export class WrapperProcess {
|
||||||
logger.info("Relaunching...");
|
logger.info("Relaunching...");
|
||||||
this.started = undefined;
|
this.started = undefined;
|
||||||
if (this.process) {
|
if (this.process) {
|
||||||
|
this.process.removeAllListeners();
|
||||||
this.process.kill();
|
this.process.kill();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -223,7 +224,9 @@ export class WrapperProcess {
|
||||||
public start(): Promise<void> {
|
public start(): Promise<void> {
|
||||||
if (!this.started) {
|
if (!this.started) {
|
||||||
const child = this.spawn();
|
const child = this.spawn();
|
||||||
this.started = ipcMain.handshake(child);
|
this.started = ipcMain.handshake(child).then(() => {
|
||||||
|
child.once("exit", (code) => exit(code!));
|
||||||
|
});
|
||||||
this.process = child;
|
this.process = child;
|
||||||
}
|
}
|
||||||
return this.started;
|
return this.started;
|
||||||
|
|
Loading…
Reference in New Issue