Last active
February 3, 2025 08:41
-
-
Save cworld1/428c64bc075295e64230259644da3881 to your computer and use it in GitHub Desktop.
MAA Resources Auto Update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set directory=MaaResource | |
REM Start MAA application | |
start ./MAA.exe | |
REM Check if .git directory exists | |
if not exist .git ( | |
echo Cloning repository... | |
git clone https://github.com/MaaAssistantArknights/MaaResource %directory% | |
if errorlevel 1 ( | |
echo Error occurred while cloning the repository. | |
pause | |
goto end | |
) | |
echo Copying files from %directory% to current directory... | |
robocopy "%directory%" "." /E /IS /IT /R:0 /W:0 | |
if !ERRORLEVEL! EQU 0 ( | |
echo Successfully copied files. | |
echo Removing directory %directory%... | |
rmdir /s /q "%directory%" | |
) else ( | |
echo Error occurred while copying files. %directory% will not be removed. | |
pause | |
) | |
) else ( | |
echo Pulling changes... | |
:loop | |
git checkout -- . | |
git pull | |
if errorlevel 1 ( | |
echo Error occurred while pulling changes. | |
set /p retry="Press 'q' to exit or any other key to retry: " | |
if /i "!retry!"=="q" ( | |
echo Exiting the loop. | |
goto end | |
) else ( | |
echo Retrying... | |
goto loop | |
) | |
) else ( | |
echo Successfully pulled changes. | |
goto end | |
) | |
) | |
:end | |
exit /b 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
注意事项:
config
文件夹,真玩坏了可以重装 maa 后配置塞回去