feat: merge install/uninstall into one interactive entrypoint
This commit is contained in:
@@ -28,6 +28,24 @@ header() {
|
||||
|
||||
header
|
||||
|
||||
echo -e "${BOLD}请选择操作:${NC}"
|
||||
echo " 1) 安装 / 更新 OpenClaw"
|
||||
echo " 2) 卸载 OpenClaw"
|
||||
read -r -p "请输入选项 [1/2](默认 1): " ACTION
|
||||
ACTION=${ACTION:-1}
|
||||
|
||||
if [[ "$ACTION" == "2" ]]; then
|
||||
info "你选择了:卸载 OpenClaw"
|
||||
if command -v openclaw &>/dev/null; then
|
||||
openclaw uninstall --all --yes --non-interactive
|
||||
else
|
||||
warn "在 PATH 中未找到 openclaw,尝试使用 npx 卸载..."
|
||||
npx -y openclaw uninstall --all --yes --non-interactive
|
||||
fi
|
||||
success "OpenClaw 已卸载。"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# 步骤 1: 检查 / 安装 Node 22+
|
||||
# ─────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user