git-watchtower 1.8.3 → 1.8.5
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/bin/git-watchtower.js +5 -4
- package/package.json +1 -1
- package/src/casino/sounds.js +13 -13
package/bin/git-watchtower.js
CHANGED
|
@@ -622,10 +622,8 @@ function startServerProcess() {
|
|
|
622
622
|
addLog(`Starting: ${SERVER_COMMAND}`, 'update');
|
|
623
623
|
addServerLog(`$ ${SERVER_COMMAND}`);
|
|
624
624
|
|
|
625
|
-
// Parse command and args
|
|
626
|
-
const
|
|
627
|
-
const cmd = parts[0];
|
|
628
|
-
const args = parts.slice(1);
|
|
625
|
+
// Parse command and args (handles quoted arguments like `npm run "my script"`)
|
|
626
|
+
const { command: cmd, args } = parseCommand(SERVER_COMMAND);
|
|
629
627
|
|
|
630
628
|
// Use shell on Windows, direct spawn elsewhere
|
|
631
629
|
const isWindows = process.platform === 'win32';
|
|
@@ -741,6 +739,9 @@ const actions = require('../src/ui/actions');
|
|
|
741
739
|
// Diff stats parsing and stash imported from src/git/commands.js
|
|
742
740
|
const { parseDiffStats, stash: gitStash, stashPop: gitStashPop } = require('../src/git/commands');
|
|
743
741
|
|
|
742
|
+
// Server process command parsing
|
|
743
|
+
const { parseCommand } = require('../src/server/process');
|
|
744
|
+
|
|
744
745
|
// State (non-store globals)
|
|
745
746
|
let previousBranchStates = new Map(); // branch name -> commit hash
|
|
746
747
|
let knownBranchNames = new Set(); // Track known branches to detect NEW ones
|
package/package.json
CHANGED
package/src/casino/sounds.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Uses system audio tools when available, falls back gracefully.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const {
|
|
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
|
-
|
|
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)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|