mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 08:53:36 +00:00
fix: guard signal forwarding against race conditions
This commit is contained in:
@@ -119,9 +119,13 @@ function runBashScript() {
|
|||||||
process.exit(code ?? 0);
|
process.exit(code ?? 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Forward signals to child process
|
// Forward signals to child process (guard against race conditions)
|
||||||
process.on('SIGINT', () => child.kill('SIGINT'));
|
process.on('SIGINT', () => {
|
||||||
process.on('SIGTERM', () => child.kill('SIGTERM'));
|
if (!child.killed) child.kill('SIGINT');
|
||||||
|
});
|
||||||
|
process.on('SIGTERM', () => {
|
||||||
|
if (!child.killed) child.kill('SIGTERM');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
runBashScript();
|
runBashScript();
|
||||||
|
|||||||
Reference in New Issue
Block a user