1
0
mirror of https://github.com/DSPBluePrints/FactoryBluePrints.git synced 2025-12-09 04:33:27 +08:00
Files
FactoryBluePrints/双击更新蓝图仓库.bat
2023-03-31 22:49:45 +08:00

45 lines
1.1 KiB
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.

chcp 65001
@echo off
set LOG_PATH=.\update.log
dir>%LOG_PATH%
echo ---->>%LOG_PATH%
echo INF: %date% %time% Start>>%LOG_PATH%
::find git
if exist ".\MinGit\cmd\git.exe" (
set GIT_PATH=.\MinGit\cmd\git.exe
echo INF: %date% %time% GIT_PATH=MinGit>>%LOG_PATH%
) else if exist "C:\Program Files\Git" (
set GIT_PATH=git
echo INF: %date% %time% GIT_PATH=Git>>%LOG_PATH%
) else (
echo 警告无法找到Git或MinGit。如果更新能正常进行请忽略 | Warning: Could not find Git or MinGit. Please ignore if the update works normally
echo WAR: %date% %time% Git/MinGit no found>>%LOG_PATH%
set GIT_PATH=git
)
::init
if not exist ".\.gitignore" (
%GIT_PATH% reset --hard
)
::update
echo INF: %date% %time% git pull start>>%LOG_PATH%
git config core.longpaths true
set GIT_SSL_NO_VERIFY=true
%GIT_PATH% pull origin main
set git_pull_errorlevel = %errorlevel%
echo INF: %date% %time% git pull exit: %git_pull_errorlevel%>>%LOG_PATH%
if %git_pull_errorlevel% NEQ 0(
echo 错误更新失败这通常是网络问题。请重试或者开加速器再更新。详见README.md
)
::end
echo INF: %date% %time% Exit>>%LOG_PATH%
pause
exit