From 9195c79e1dbddbf9defc090be6f0c080b77da6fa Mon Sep 17 00:00:00 2001 From: Lukas Kosina Date: Mon, 2 Mar 2026 16:23:16 +0100 Subject: [PATCH 1/2] Fix install to stop and uninstall before reinstalling The install command now stops any running dashboard and uninstalls the previous installation before performing a fresh install. This ensures the new version propagates immediately after installation. The uninstall command also now stops the running dashboard first. Fixes #32 --- src/bin.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin.ts b/src/bin.ts index b9001eb..b570142 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -199,12 +199,19 @@ function main(): void { const { port, command, noHooks, noOpen } = parseArgs(process.argv); if (command === "install") { - install(port); + (async () => { + await stopServer(); + uninstall(); + install(port); + })(); return; } if (command === "uninstall") { - uninstall(); + (async () => { + await stopServer(); + uninstall(); + })(); return; } From a1659cd1df48b8b70ab08c5b53348bda55d259c0 Mon Sep 17 00:00:00 2001 From: Lukas Kosina Date: Mon, 2 Mar 2026 16:25:52 +0100 Subject: [PATCH 2/2] Add error handling to async install/uninstall flows Add .catch() handlers to the async IIFEs in install and uninstall commands to prevent unhandled promise rejections and provide meaningful error messages on failure. --- src/bin.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin.ts b/src/bin.ts index b570142..26dad55 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -203,7 +203,10 @@ function main(): void { await stopServer(); uninstall(); install(port); - })(); + })().catch((err) => { + console.error("Install failed:", err); + process.exit(1); + }); return; } @@ -211,7 +214,10 @@ function main(): void { (async () => { await stopServer(); uninstall(); - })(); + })().catch((err) => { + console.error("Uninstall failed:", err); + process.exit(1); + }); return; }