mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
refactor: dedupe config cli command trimmed readers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Command } from "commander";
|
||||
import { loadNodeHostConfig } from "../../node-host/config.js";
|
||||
import { runNodeHost } from "../../node-host/runner.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { parsePort } from "../daemon-cli/shared.js";
|
||||
@@ -48,7 +49,9 @@ export function registerNodeCli(program: Command) {
|
||||
.action(async (opts) => {
|
||||
const existing = await loadNodeHostConfig();
|
||||
const host =
|
||||
(opts.host as string | undefined)?.trim() || existing?.gateway?.host || "127.0.0.1";
|
||||
normalizeOptionalString(opts.host as string | undefined) ||
|
||||
existing?.gateway?.host ||
|
||||
"127.0.0.1";
|
||||
const port = parsePortWithFallback(opts.port, existing?.gateway?.port ?? 18789);
|
||||
await runNodeHost({
|
||||
gatewayHost: host,
|
||||
|
||||
Reference in New Issue
Block a user