fix: address notifier onboarding review (#1958)

This commit is contained in:
whoisasx 2026-05-20 21:34:46 +05:30
parent d5f3e1963f
commit 7f566a331b
3 changed files with 6 additions and 4 deletions

View File

@ -176,7 +176,7 @@ async function ensureDefaultStartupNotifiers(
dashboardUrl,
desktopMode,
});
return changed ? loadConfig(config.configPath) : config;
return changed ? loadConfig(targetConfigPath) : config;
}
function readProjectBehaviorConfig(projectPath: string): LocalProjectConfig {

View File

@ -11,7 +11,9 @@ import { makeEvent } from "./helpers/event-factory.js";
vi.mock("node:child_process", () => ({
execFile: vi.fn(),
execFileSync: vi.fn(() => {
throw new Error("not found");
const error = new Error("not found") as NodeJS.ErrnoException;
error.code = "ENOENT";
throw error;
}),
}));

View File

@ -383,8 +383,8 @@ function detectTerminalNotifier(): boolean {
try {
execFileSync("terminal-notifier", ["--version"], { stdio: "ignore", windowsHide: true });
return true;
} catch {
return false;
} catch (error) {
return (error as NodeJS.ErrnoException).code !== "ENOENT";
}
}