fix(cli): restore terminal guidance typecheck · openclaw/openclaw@c7c7e2b
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
File tree
onboard-non-interactive/local
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,19 +23,18 @@ export function applyNonInteractiveGatewayConfig(params: {
|
23 | 23 | } | null { |
24 | 24 | const { opts, runtime } = params; |
25 | 25 | |
26 | | -const hasGatewayPort = opts.gatewayPort !== undefined; |
| 26 | +const gatewayPort = opts.gatewayPort; |
| 27 | +const hasGatewayPort = gatewayPort !== undefined; |
27 | 28 | if ( |
28 | 29 | hasGatewayPort && |
29 | | -(!Number.isFinite(opts.gatewayPort) || |
30 | | -(opts.gatewayPort ?? 0) <= 0 || |
31 | | -opts.gatewayPort > 65_535) |
| 30 | +(!Number.isFinite(gatewayPort) || gatewayPort <= 0 || gatewayPort > 65_535) |
32 | 31 | ) { |
33 | 32 | runtime.error(formatInvalidPortOption("--gateway-port")); |
34 | 33 | runtime.exit(1); |
35 | 34 | return null; |
36 | 35 | } |
37 | 36 | |
38 | | -const port = hasGatewayPort ? (opts.gatewayPort as number) : params.defaultPort; |
| 37 | +const port = gatewayPort ?? params.defaultPort; |
39 | 38 | let bind = opts.gatewayBind ?? "loopback"; |
40 | 39 | const authModeRaw = opts.gatewayAuth ?? "token"; |
41 | 40 | if (authModeRaw !== "token" && authModeRaw !== "password") { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
| 2 | +import { formatCliCommand } from "../cli/command-format.js"; |
2 | 3 | import { formatLookupMiss } from "../cli/error-format.js"; |
3 | 4 | import { getRuntimeConfig } from "../config/config.js"; |
4 | 5 | import { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。