65 lines
1.2 KiB
Batchfile
65 lines
1.2 KiB
Batchfile
@echo off
|
|
chcp 65001
|
|
setlocal EnableDelayedExpansion
|
|
cd /d %~dp0
|
|
|
|
net.exe session 1>NUL 2>NUL && (
|
|
goto as_admin
|
|
) || (
|
|
goto not_admin
|
|
)
|
|
|
|
:as_admin
|
|
set versionPath=%cd%
|
|
cd ..
|
|
set rootPath=%cd%
|
|
|
|
::读取项目配置
|
|
set appName="xxxxx"
|
|
set file99=%rootPath%\config.txt
|
|
if exist %file99% (
|
|
for /f "tokens=*" %%a in (%file99%) do (
|
|
set var=%%a
|
|
|
|
if "!var:~0,16!"=="applicationName:" (
|
|
set appName=!var:~16,-1!!var:~-1,1!
|
|
)
|
|
)
|
|
set appName=!appName!
|
|
)
|
|
|
|
::检查是否主干项目
|
|
if not exist %rootPath%\%appName%.master (
|
|
echo 是否是合并后初始化
|
|
pause
|
|
echo .>%rootPath%\%appName%.master
|
|
)
|
|
|
|
del /s /q %rootPath%\%appName%.branch.*
|
|
|
|
::读取版本配置文件
|
|
cd /d %versionPath%
|
|
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!
|
|
del /q %versionPath%\*.panda
|
|
del /q %rootPath%\*.panda
|
|
echo .>%versionPath%\%oldVersion%.panda
|
|
echo .>%rootPath%\%oldVersion%.panda
|
|
|
|
echo 执行成功
|
|
goto end
|
|
|
|
:not_admin
|
|
echo not as admin
|
|
|
|
:end
|
|
ping 127.0.0.1 -n 10 >nul
|
|
exit
|
|
|