Files
Commercialization.topon/Update Upm.bat

37 lines
858 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 936
color a
echo 开始提交到git upm....
echo 提交upm前请确保当前分支所有改动都已经提交
:: 使用 findstr 从 package.json 中提取版本号
for /f "tokens=2 delims=:, " %%i in ('findstr "version" Assets\package.json') do (
set version=%%i
)
:: 移除引号
set version=%version:"=%
echo 从package.json中读取的版本号为%version%
:: 检查tag是否已存在
git tag | findstr "%version%" > nul
if %errorlevel% equ 0 (
echo 错误:版本号 %version% 对应的tag已存在
pause
exit
)
set /p Flg=确认提交的版本号%version%,是否开始提交(y/n) -------- :
IF "%Flg%" equ "y" (
echo 开始提交,请勿关闭该窗口!
git subtree split --prefix=Assets --branch upm
git tag %version% upm
git push origin upm --tags
GOTO :END
)
:END
echo 执行完成!
pause
exit