git-watchtower 1.8.3 → 1.8.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
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": {
@@ -5,7 +5,7 @@
5
5
  * Uses system audio tools when available, falls back gracefully.
6
6
  */
7
7
 
8
- const { exec } = require('child_process');
8
+ const { execFile } = require('child_process');
9
9
  const path = require('path');
10
10
  const fs = require('fs');
11
11
 
@@ -56,20 +56,20 @@ function playFile(soundPath, volume = 0.5) {
56
56
 
57
57
  try {
58
58
  if (platform === 'darwin') {
59
- // macOS: afplay with volume
60
- exec(`afplay -v ${volume} "${soundPath}" 2>/dev/null &`);
59
+ // macOS: afplay with volume — args passed as array (no shell)
60
+ execFile('afplay', ['-v', String(volume), soundPath], () => {});
61
61
  } else if (platform === 'linux') {
62
- // Linux: paplay (PulseAudio) or aplay (ALSA)
63
- // Note: paplay doesn't support volume easily, aplay does via amixer
64
- exec(
65
- `paplay "${soundPath}" 2>/dev/null || aplay -q "${soundPath}" 2>/dev/null &`
66
- );
62
+ // Linux: paplay (PulseAudio), fall back to aplay (ALSA)
63
+ execFile('paplay', [soundPath], (err) => {
64
+ if (err) {
65
+ execFile('aplay', ['-q', soundPath], () => {});
66
+ }
67
+ });
67
68
  } else if (platform === 'win32') {
68
- // Windows: Use PowerShell to play sound
69
- exec(
70
- `powershell -c "(New-Object Media.SoundPlayer '${soundPath}').PlaySync()" 2>nul`,
71
- { windowsHide: true }
72
- );
69
+ // Windows: Use PowerShell to play sound — path passed as argument
70
+ execFile('powershell', [
71
+ '-c', `(New-Object Media.SoundPlayer $args[0]).PlaySync()`, '-args', soundPath,
72
+ ], { windowsHide: true }, () => {});
73
73
  }
74
74
  } catch (e) {
75
75
  // Silently fail - sounds are optional