From 2c1ae27a3afb6b58136a17a4afb97ba45eca2e64 Mon Sep 17 00:00:00 2001 From: QWsin Date: Mon, 30 Mar 2026 14:00:24 +0800 Subject: [PATCH] fix(hooks): capture stderr properly in notifyWindows Change stdio to ['ignore', 'pipe', 'pipe'] so stderr is captured and can be logged on errors. Without this, result.stderr is null and error logs show 'undefined' instead of the actual error. --- scripts/hooks/desktop-notify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/hooks/desktop-notify.js b/scripts/hooks/desktop-notify.js index 75375500..efab5a22 100644 --- a/scripts/hooks/desktop-notify.js +++ b/scripts/hooks/desktop-notify.js @@ -117,7 +117,7 @@ function notifyWindows(pwshPath, title, body) { const safeBody = body.replace(/'/g, "''"); const safeTitle = title.replace(/'/g, "''"); const command = `Import-Module BurntToast; New-BurntToastNotification -Text '${safeTitle}', '${safeBody}'`; - const result = spawnSync(pwshPath, ['-Command', command], { stdio: 'ignore', timeout: 5000 }); + const result = spawnSync(pwshPath, ['-Command', command], { stdio: ['ignore', 'pipe', 'pipe'], timeout: 5000 }); if (result.error || result.status !== 0) { log(`[DesktopNotify] BurntToast failed (exit ${result.status}): ${result.error ? result.error.message : result.stderr?.toString()}`); }