mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 23:12:30 +02:00
fix: add spawnSync error logging and restore 5s timeout
- Check spawnSync result and log warning on failure via stderr - Restore osascript timeout to 5000ms, increase hook deadline to 10s for sufficient headroom
This commit is contained in:
parent
d3699f9010
commit
f6b10481f3
2 changed files with 5 additions and 2 deletions
|
|
@ -47,7 +47,10 @@ function notifyMacOS(title, body) {
|
|||
const safeBody = body.replace(/\\/g, '').replace(/"/g, '\u201C');
|
||||
const safeTitle = title.replace(/\\/g, '').replace(/"/g, '\u201C');
|
||||
const script = `display notification "${safeBody}" with title "${safeTitle}"`;
|
||||
spawnSync('osascript', ['-e', script], { stdio: 'ignore', timeout: 3000 });
|
||||
const result = spawnSync('osascript', ['-e', script], { stdio: 'ignore', timeout: 5000 });
|
||||
if (result.error || result.status !== 0) {
|
||||
log(`[DesktopNotify] osascript failed: ${result.error ? result.error.message : `exit ${result.status}`}`);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: future platform support
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue