1
0
mirror of https://github.com/DSPBluePrints/FactoryBluePrints.git synced 2025-12-08 23:13:35 +08:00

进一步完善了README和update.bat的报错提示

This commit is contained in:
bWFuanVzYWth
2023-05-11 14:20:51 +08:00
parent 9d6aba01a7
commit 2efa48b535
2 changed files with 24 additions and 7 deletions

View File

@@ -7,6 +7,14 @@ set LOG_PATH=.\update.log
dir>%LOG_PATH%
echo ---->>%LOG_PATH%
::test dir
cd ..
cd ..
if not exist "Blueprint" (
echo 警告:您似乎安装到了错误的路径,这可能导致文件权限异常
)
cd %~dp0
::find git.exe
if exist ".\MinGit\cmd\git.exe" (
set GIT_PATH=.\MinGit\cmd\git.exe
@@ -19,14 +27,14 @@ echo %date% %time% Infomation: GIT_PATH=git>>%LOG_PATH%
::test git.exe
%GIT_PATH% -v
if %errorlevel% NEQ 0 (
echo 错误无法找到git.exe ^| Error: git.exe no found
echo 错误无法找到git.exe
echo %date% %time% Error: git.exe no found>>%LOG_PATH%
goto end_with_error
)
::find .git/
if not exist ".git" (
echo 错误:无法找到.git/ ^| Error: .git no found
echo 错误:无法找到.git/
echo %date% %time% Error: .git/ no found>>%LOG_PATH%
goto end_with_error
)
@@ -34,7 +42,7 @@ goto end_with_error
::test .git/
%GIT_PATH% rev-parse --is-inside-work-tree
if %errorlevel% NEQ 0 (
echo 错误:.git/已损坏 ^| Error: .git/ is broken
echo 错误:.git/已损坏
echo %date% %time% Error: .git/ is broken>>%LOG_PATH%
goto end_with_error
)
@@ -49,7 +57,7 @@ echo %date% %time% Infomation: %GIT_PATH% reset --hard>>%LOG_PATH%
set GIT_SSL_NO_VERIFY=true
%GIT_PATH% pull origin main
if %errorlevel% NEQ 0 (
echo 错误:更新失败这通常是网络问题。请重试,或者开加速器再更新。详见"README.md"
echo 错误:更新失败这通常是网络问题,重试就行,或者开加速器再更新。
echo %date% %time% Error: %GIT_PATH% pull origin main>>%LOG_PATH%
goto end_with_error
) else (
@@ -57,13 +65,15 @@ echo %date% %time% Infomation: %GIT_PATH% pull origin main>>%LOG_PATH%
)
:end
echo 更新完成,现在可以直接关闭此窗口
echo 蓝图文件更新完成,现在可以直接关闭此窗口
echo %date% %time% Infomation: Exit>>%LOG_PATH%
pause
exit
:end_with_error
echo 更新因为出现错误而终止。如果存疑可以加qq群反馈162065696
echo 更新因为出现错误而中止,蓝图文件没有发生任何变动
echo 常见问题请阅读说明https://github.com/DSPBluePrints/FactoryBluePrints/blob/main/README.md
echo 如果仍然存疑可以加qq群反馈162065696。请附上此页面截图和update.log截图。
echo %date% %time% Infomation: Exit>>%LOG_PATH%
pause
exit