v3.2: 非交互模式跳过 onboard 并以 0 退出(预期行为非失败)
This commit is contained in:
+11
-3
@@ -863,9 +863,13 @@ onboard_and_start() {
|
||||
ok "检测到 OpenClaw gateway 已在运行,跳过初始化。"
|
||||
else
|
||||
if [ "$NONINTERACTIVE" = "1" ] || [ ! -t 0 ]; then
|
||||
info "非交互模式:执行 openclaw onboard --install-daemon(自动模式)…"
|
||||
run_quiet openclaw onboard --install-daemon || \
|
||||
warn "onboard 未成功完成,稍后可手动运行:openclaw onboard --install-daemon"
|
||||
# 非交互模式:onboard 需要 TTY 交互(选模型/配渠道),无法自动完成。
|
||||
# 此时未配置任何 provider/渠道,即使强行启动 gateway 也不可用,
|
||||
# 因此直接跳过并给出明确后续指引,这是预期行为而非失败。
|
||||
NONINTERACTIVE_SKIPPED=1
|
||||
warn "非交互模式:已跳过初始化与启动。"
|
||||
hint "OpenClaw 已安装完成,但尚未配置。请在交互终端中执行 ${C_BOLD}claw${C_RESET} 完成配置后再启动。"
|
||||
return 0
|
||||
else
|
||||
plain "接下来运行 ${C_BOLD}openclaw onboard --install-daemon${C_RESET} 完成初始化并安装 systemd 服务。"
|
||||
plain "该命令可能会有自己的交互提问,按屏幕提示回答即可。"
|
||||
@@ -1181,6 +1185,10 @@ main() {
|
||||
|
||||
summary
|
||||
|
||||
if [ "${NONINTERACTIVE_SKIPPED:-0}" = "1" ]; then
|
||||
ok "安装完成。请在交互终端执行 claw 完成配置并启动。"
|
||||
exit 0
|
||||
fi
|
||||
if [ "$start_rc" -eq 0 ]; then
|
||||
ok "全部完成,祝使用愉快。"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user