mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:58:27 +00:00
refactor(daemon): dedupe install output line writing
This commit is contained in:
@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { splitArgsPreservingQuotes } from "./arg-split.js";
|
||||
import { resolveGatewayServiceDescription, resolveGatewayWindowsTaskName } from "./constants.js";
|
||||
import { formatLine } from "./output.js";
|
||||
import { formatLine, writeFormattedLines } from "./output.js";
|
||||
import { resolveGatewayStateDir } from "./paths.js";
|
||||
import { parseKeyValueOutput } from "./runtime-parse.js";
|
||||
import { execSchtasks } from "./schtasks-exec.js";
|
||||
@@ -230,9 +230,14 @@ export async function installScheduledTask({
|
||||
|
||||
await execSchtasks(["/Run", "/TN", taskName]);
|
||||
// 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 Scheduled Task", taskName)}\n`);
|
||||
stdout.write(`${formatLine("Task script", scriptPath)}\n`);
|
||||
writeFormattedLines(
|
||||
stdout,
|
||||
[
|
||||
{ label: "Installed Scheduled Task", value: taskName },
|
||||
{ label: "Task script", value: scriptPath },
|
||||
],
|
||||
{ leadingBlankLine: true },
|
||||
);
|
||||
return { scriptPath };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user