git-watchtower 1.10.13 → 1.10.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -656,6 +656,9 @@ function startServerProcess() {
656
656
  env: { ...process.env, FORCE_COLOR: '1' },
657
657
  shell: isWindows,
658
658
  stdio: ['ignore', 'pipe', 'pipe'],
659
+ // On Unix, create a new process group so we can kill the entire tree
660
+ // (e.g. npm -> node -> next). On Windows, taskkill /t handles this.
661
+ detached: !isWindows,
659
662
  };
660
663
 
661
664
  try {
@@ -713,13 +716,19 @@ function stopServerProcess() {
713
716
  if (process.platform === 'win32') {
714
717
  spawn('taskkill', ['/pid', proc.pid.toString(), '/f', '/t']);
715
718
  } else {
716
- proc.kill('SIGTERM');
719
+ // Kill the entire process group (negative PID) so that
720
+ // grandchildren (e.g. npm -> node -> vite) are also terminated.
721
+ try {
722
+ process.kill(-proc.pid, 'SIGTERM');
723
+ } catch (e) {
724
+ // Process group may already be dead
725
+ }
717
726
  // Force kill after grace period if process hasn't exited
718
727
  const forceKillTimeout = setTimeout(() => {
719
728
  try {
720
- proc.kill('SIGKILL');
729
+ process.kill(-proc.pid, 'SIGKILL');
721
730
  } catch (e) {
722
- // Process may already be dead
731
+ // Process group may already be dead
723
732
  }
724
733
  }, 3000);
725
734
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.10.13",
3
+ "version": "1.10.14",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {
@@ -174,6 +174,9 @@ class ProcessManager {
174
174
  env: { ...process.env, FORCE_COLOR: '1' },
175
175
  shell: isWindows,
176
176
  stdio: ['ignore', 'pipe', 'pipe'],
177
+ // On Unix, create a new process group so we can kill the entire tree
178
+ // (e.g. npm -> node -> next). On Windows, taskkill /t handles this.
179
+ detached: !isWindows,
177
180
  };
178
181
 
179
182
  try {
@@ -247,14 +250,16 @@ class ProcessManager {
247
250
  }
248
251
  } else {
249
252
  try {
250
- proc.kill('SIGTERM');
253
+ // Kill the entire process group (negative PID) so that
254
+ // grandchildren (e.g. npm -> node -> vite) are also terminated.
255
+ process.kill(-proc.pid, 'SIGTERM');
251
256
 
252
257
  // Force kill after grace period
253
258
  const forceKillTimeout = setTimeout(() => {
254
259
  try {
255
- proc.kill('SIGKILL');
260
+ process.kill(-proc.pid, 'SIGKILL');
256
261
  } catch (e) {
257
- // Process may already be dead
262
+ // Process group may already be dead
258
263
  }
259
264
  }, KILL_GRACE_PERIOD);
260
265
 
@@ -263,7 +268,7 @@ class ProcessManager {
263
268
  clearTimeout(forceKillTimeout);
264
269
  });
265
270
  } catch (e) {
266
- // Process may already be dead
271
+ // Process group may already be dead
267
272
  }
268
273
  }
269
274