59 lines
1.1 KiB
Batchfile
Raw Normal View History

2024-01-04 15:47:33 +08:00
@echo off
setlocal EnableDelayedExpansion
cd /d %~dp0
net.exe session 1>NUL 2>NUL && (
goto as_admin
) || (
goto not_admin
)
:as_admin
::<3A><>ȡ<EFBFBD><EFBFBD><E6B1BE><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
if not exist version.txt echo 1.0.0.20000101>version.txt
set configVersion=version.txt
for /f "tokens=1,2,3 delims=." %%a IN (%configVersion%) Do (
set tag1=%%a
set tag2=%%b
set tag3=%%c
)
set oldVersion=%tag1%.%tag2%.%tag3%
2024-01-04 18:20:28 +08:00
::<3A><EFBFBD><E1BDBB><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ڵ<EFBFBD>
set verPath=%cd%
cd ..
set rootPath=%cd%
cd /d %rootPath%
set tagName=%oldVersion%_%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
git tag -a %tagName% -m <20><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
git push origin %tagName%
set /a tag3=1+%tag3%
set newVersion=%tag1%.%tag2%.%tag3%
2024-01-04 15:47:33 +08:00
::<3A>
set d=%date: =0%
set t=%time: =0%
2024-01-04 18:20:28 +08:00
cd /d %verPath%
set productname=%newVersion%.%d:~2,2%%d:~5,2%%d:~8,2%%t:~0,2%%t:~3,2%%t:~6,2%
2024-01-04 15:47:33 +08:00
echo %productname%
echo %productname%> version.txt
del /q *.panda
2024-01-04 18:20:28 +08:00
echo .>%newVersion%.panda
2024-01-04 15:47:33 +08:00
cd ..
del /q *.panda
2024-01-04 18:20:28 +08:00
echo .>%newVersion%.panda
2024-01-04 15:47:33 +08:00
echo ִ<>гɹ<D0B3><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> v%oldVersion%
goto end
:not_admin
echo not as admin
:end
2024-01-04 18:20:28 +08:00
ping 127.0.0.1 -n 10 >nul
2024-01-04 15:47:33 +08:00
exit