diff --git a/build.exe b/build.exe index e72931a..470db4c 100644 Binary files a/build.exe and b/build.exe differ diff --git a/deploy.sh b/deploy.sh index 384e0e4..27a2094 100644 --- a/deploy.sh +++ b/deploy.sh @@ -36,7 +36,7 @@ fi # ---------- 配置 ---------- REPO_URL="https://git.whitetop.xyz/lxh2875931338/frpc-console.git" -BRANCH="main" +BRANCH="main" # 默认 main,select_channel 会根据选择修改 WORK_DIR="/tmp/frpc-console-build" DEFAULT_PORT=9300 DEFAULT_DEPLOY_DIR="/opt/frpc-console" @@ -99,8 +99,8 @@ parse_args() { echo "用法: ./deploy.sh [选项]" echo "" echo "选项:" - echo " --channel lts 使用 LTS 通道" - echo " --channel preview 使用 Preview 通道" + echo " --channel lts 使用 LTS 通道 (main 分支)" + echo " --channel preview 使用 Preview 通道 (test 分支)" echo " --yes, -y 跳过所有确认提示" echo " --check 只检测环境,不执行部署" echo " --dry-run 显示将执行的操作,不实际执行" @@ -109,6 +109,7 @@ parse_args() { echo "示例:" echo " ./deploy.sh # 交互式选择通道" echo " ./deploy.sh --channel lts # 部署 LTS 版本" + echo " ./deploy.sh --channel preview # 部署 Preview 版本" echo " ./deploy.sh --yes # 无人值守部署" exit 0 ;; @@ -283,28 +284,43 @@ compare_version() { fi } -# ---------- 通道选择 ---------- +# ---------- 通道选择(含分支切换)---------- select_channel() { if [ -n "$CHANNEL" ]; then if [ "$CHANNEL" != "lts" ] && [ "$CHANNEL" != "preview" ]; then print_error "无效通道: $CHANNEL (仅支持 lts / preview)" exit 1 fi + if [ "$CHANNEL" = "preview" ]; then + BRANCH="test" + else + BRANCH="main" + fi return fi echo "" echo -e "${CYAN}请选择部署通道:${NC}" - echo " 1. LTS (稳定版,生产推荐) [默认]" - echo " 2. Preview (技术预览版,包含新特性)" + echo " 1. LTS (稳定版,生产推荐) [默认] → main 分支" + echo " 2. Preview (技术预览版,包含新特性) → test 分支" echo "" read -p "请选择 [1]: " CHANNEL_INPUT