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 +1 -1
- package/src/casino/sounds.js +13 -13
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
|