From 7aa7605ff55ccfff38602f8253db08ef36f85416 Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 18 Dec 2025 16:57:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20release.bat=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E8=AF=BB=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 切换到脚本所在目录确保路径正确 - 使用 type | findstr 替代直接 findstr 读取文件 - 添加版本号读取失败的错误处理 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- release.bat | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/release.bat b/release.bat index 2fada6c..d9d771c 100644 --- a/release.bat +++ b/release.bat @@ -1,5 +1,5 @@ @echo off -chcp 65001 >nul +chcp 65001 >nul 2>&1 setlocal EnableDelayedExpansion echo ======================================== @@ -7,6 +7,9 @@ echo PackagingMallShipper - Release Tool echo ======================================== echo. +:: 切换到脚本所在目录 +cd /d "%~dp0" + :: 检查 Inno Setup set "ISCC=" if exist "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ( @@ -27,10 +30,18 @@ if "%ISCC%"=="" ( ) :: 读取当前版本号 -for /f "tokens=2 delims=<>" %%a in ('findstr /C:"" PackagingMallShipper\PackagingMallShipper.csproj') do ( +set "CURRENT_VERSION=" +for /f "tokens=2 delims=<>" %%a in ('type "PackagingMallShipper\PackagingMallShipper.csproj" ^| findstr ""') do ( set "CURRENT_VERSION=%%a" ) +if "%CURRENT_VERSION%"=="" ( + echo [Error] Could not read version from csproj file + echo. + pause + exit /b 1 +) + echo [Info] Current version: %CURRENT_VERSION% echo.