diff --git a/deploy.sh b/deploy.sh index 30c2938..bebe316 100755 --- a/deploy.sh +++ b/deploy.sh @@ -155,8 +155,12 @@ if run_tests; then if [ -n "$BG_TARGET" ]; then echo -e " 目标: ${BG_TARGET} (:${BG_PORT})" echo -e "" - echo -e " ${YELLOW}切换命令:${NC}" - echo -e " ./scripts/switch-env.sh --switch ${BG_TARGET}" + echo -e " ${YELLOW}自动切换代理...${NC}" + if bash "${SCRIPT_DIR}/scripts/switch-env.sh" --switch "${BG_TARGET}" 2>&1; then + log_info "代理已切换至 ${BG_TARGET} (:${BG_PORT})" + else + log_warn "代理切换失败,请手动执行: ./scripts/switch-env.sh --switch ${BG_TARGET}" + fi fi echo "" [ "$POST_DEPLOY_LOGS" = true ] && { echo ""; view_logs; }