GrassClipper/scripts/resources_download.cmd

29 lines
945 B
Batchfile
Raw Permalink Normal View History

2022-05-02 04:07:09 +00:00
@echo off
set FOLDER_NAME=%1
set FOLDER_NAME=%FOLDER_NAME:"=%
if not exist ".\temp" mkdir ".\temp"
2022-05-08 00:15:54 +00:00
if not exist "%FOLDER_NAME%\resources" mkdir "%FOLDER_NAME%\resources"
2022-05-02 04:07:09 +00:00
echo Downloading resources, this can take a while...
:: Grab the giant ass resource zip
2022-05-06 04:52:20 +00:00
powershell Invoke-WebRequest -Uri https://github.com/Koko-boya/Grasscutter_Resources/archive/refs/heads/main.zip -OutFile ".\temp\resources.zip"
2022-05-02 04:07:09 +00:00
echo Extracting...
:: Extract resources to the folder
2022-05-06 04:52:20 +00:00
powershell Expand-Archive -Path ".\temp\resources.zip" -DestinationPath "%FOLDER_NAME%" -Force
2022-05-02 04:07:09 +00:00
:: Delete old resources folder if there is one there
del /s /q "%FOLDER_NAME%\resources">nul
2022-05-08 00:32:30 +00:00
echo Moving resources to folder (this also takes a bit)...
2022-05-02 04:07:09 +00:00
robocopy "%FOLDER_NAME%\Grasscutter_Resources-main\Resources" "%FOLDER_NAME%\resources" /E /MOVE>nul
:: Delete straggling files
del /s /q "%FOLDER_NAME%\Grasscutter_Resources-main"
echo Done, resources should be properly extracted