@echo off chcp 65001 >nul 2>&1 :: ============================================ :: Claude AI Installer Windows 发布脚本 :: Release script for Windows :: 此脚本作为 scripts/release.js 的简单入口 :: ============================================ :: 切换到脚本所在目录 cd /d "%~dp0" :: 检查是否请求帮助 if /i "%~1"=="--help" goto :show_help if /i "%~1"=="-h" goto :show_help :: 检查 Node.js where node >nul 2>&1 if errorlevel 1 ( echo [x] 未找到 Node.js,请先安装 Node.js pause exit /b 1 ) :: 检查 node_modules if not exist "node_modules" ( echo [!] 未找到 node_modules,正在安装依赖... call npm install if errorlevel 1 ( echo [x] 安装依赖失败 pause exit /b 1 ) ) :: 转换参数并调用 Node.js 脚本 :: release.js 在 Windows 上已默认只构建 win 平台 :: 默认版本类型为 patch set "NODE_ARGS=patch" :parse_args if "%~1"=="" goto :run_release if /i "%~1"=="patch" set "NODE_ARGS=patch" & shift & goto :parse_args if /i "%~1"=="minor" set "NODE_ARGS=minor" & shift & goto :parse_args if /i "%~1"=="major" set "NODE_ARGS=major" & shift & goto :parse_args if /i "%~1"=="--dry-run" set "NODE_ARGS=%NODE_ARGS% --dry-run" & shift & goto :parse_args if /i "%~1"=="--platform" set "NODE_ARGS=%NODE_ARGS% --platform %~2" & shift & shift & goto :parse_args if /i "%~1"=="-p" set "NODE_ARGS=%NODE_ARGS% --platform %~2" & shift & shift & goto :parse_args shift goto :parse_args :run_release echo. echo ^> 调用 Node.js 发布脚本... echo 执行: node scripts/release.cjs %NODE_ARGS% echo. call node scripts/release.cjs %NODE_ARGS% if errorlevel 1 ( echo. echo [x] 发布失败! echo. pause exit /b 1 ) echo. pause goto :eof :: ============================================ :: 显示帮助信息 :: ============================================ :show_help echo. echo Claude AI Installer Windows 发布脚本 echo. echo 用法: echo release-win.bat [版本类型] [参数] echo. echo 版本类型: echo patch 补丁版本 +1 (默认, 如: 0.0.1 -^> 0.0.2) echo minor 次版本 +1 (如: 0.0.1 -^> 0.1.0) echo major 主版本 +1 (如: 0.0.1 -^> 1.0.0) echo. echo 参数: echo --dry-run 仅显示操作,不实际执行 echo --platform, -p 指定平台 (逗号分隔): win,mac,linux echo --help, -h 显示此帮助信息 echo. echo 示例: echo release-win.bat 更新 patch 版本并构建 echo release-win.bat minor 更新 minor 版本并构建 echo release-win.bat --dry-run 预览发布操作 echo. echo 输出: echo release\Claude-AI-Installer-x.x.x-win-x64-setup.exe (NSIS 安装程序) echo release\Claude-AI-Installer-x.x.x-win-x64.msi (MSI 安装程序) echo release\Claude-AI-Installer-x.x.x-win-x64-portable.exe (便携版,无需安装) echo. echo 注意: 此脚本调用 scripts/release.cjs 执行实际发布 echo Windows 上默认只构建 win 平台 echo. goto :eof