Add command to kill server and trigger handled error

This commit is contained in:
Alex Dima
2021-01-13 20:45:27 +01:00
parent 23be24d828
commit 31a15b5b9a
3 changed files with 19 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ export function terminateProcess(p: cp.ChildProcess, extensionPath: string): Ter
} else if (process.platform === 'darwin' || process.platform === 'linux') {
try {
const cmd = path.join(extensionPath, 'scripts', 'terminateProcess.sh');
const result = cp.spawnSync(cmd, [process.pid.toString()]);
const result = cp.spawnSync(cmd, [p.pid.toString()]);
if (result.error) {
return { success: false, error: result.error };
}
@@ -34,4 +34,4 @@ export function terminateProcess(p: cp.ChildProcess, extensionPath: string): Ter
p.kill('SIGKILL');
}
return { success: true };
}
}