fix(watcher): always tree-kill on stop regardless of childProcess.killed flag
The direct bash child may already be dead from terminal SIGINT while grandchildren (tsrun, devserver) are still running. Removing the .killed guard ensures tree-kill always runs to clean up the entire process tree.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@git.zone/tswatch",
|
||||
"version": "3.2.2",
|
||||
"version": "3.2.3",
|
||||
"private": false,
|
||||
"description": "A development tool for automatically watching and re-compiling TypeScript projects upon detecting file changes, enhancing developer workflows.",
|
||||
"exports": {
|
||||
|
||||
4408
pnpm-lock.yaml
generated
4408
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -202,7 +202,9 @@ export class Watcher {
|
||||
clearTimeout(this.debounceTimer);
|
||||
}
|
||||
await this.smartwatchInstance.stop();
|
||||
if (this.currentExecution && !this.currentExecution.childProcess.killed) {
|
||||
if (this.currentExecution) {
|
||||
// Always tree-kill — even if the direct child is dead (.killed === true),
|
||||
// grandchildren (e.g. tsrun, devserver) may still be running.
|
||||
await this.currentExecution.kill();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user