refactor(daemon): dedupe install output line writing

This commit is contained in:
Peter Steinberger
2026-02-18 23:58:05 +00:00
parent 89a0b95af4
commit 2709c0ba51
4 changed files with 42 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ import {
resolveGatewaySystemdServiceName,
} from "./constants.js";
import { execFileUtf8 } from "./exec-file.js";
import { formatLine, toPosixPath } from "./output.js";
import { formatLine, toPosixPath, writeFormattedLines } from "./output.js";
import { resolveHomeDir } from "./paths.js";
import { parseKeyValueOutput } from "./runtime-parse.js";
import type { GatewayServiceRuntime } from "./service-runtime.js";
@@ -227,8 +227,16 @@ export async function installSystemdService({
}
// Ensure we don't end up writing to a clack spinner line (wizards show progress without a newline).
stdout.write("\n");
stdout.write(`${formatLine("Installed systemd service", unitPath)}\n`);
writeFormattedLines(
stdout,
[
{
label: "Installed systemd service",
value: unitPath,
},
],
{ leadingBlankLine: true },
);
return { unitPath };
}