made the pack completely portable and wrote relevent bat files to go with it

This commit is contained in:
Draqoken
2025-04-09 17:04:56 +03:00
parent 5e77d7e9cf
commit 5e4144c3c0
7417 changed files with 2181044 additions and 19 deletions

View File

@@ -22,11 +22,24 @@ if "%CURRENT_DIR:~-1%"=="\" set "CURRENT_DIR=%CURRENT_DIR:~0,-1%"
set "TARGET_DIR=%USERPROFILE%\Documents\VIP Mud\Cosmic Rage"
set "SET_FILE=%TARGET_DIR%\cosmic rage.set"
set "LOADER_FILE=%TARGET_DIR%\loader.set"
set "SOUNDS_DIR=%CURRENT_DIR%\sounds"
set "REPO_URL=http://nathantech.net:3000/CosmicRage/CosmicRageSounds"
set "REPO_SUBFOLDER=wav"
set "GIT_PORTABLE=%CURRENT_DIR%\gitportable\bin\git.exe"
echo [%DATE% %TIME%] Script location: %CURRENT_DIR% >> "%LOG_FILE%"
echo [%DATE% %TIME%] Target directory: %TARGET_DIR% >> "%LOG_FILE%"
echo [%DATE% %TIME%] Sounds directory: %SOUNDS_DIR% >> "%LOG_FILE%"
:: --------- Handle Existing Folder ---------
:: --------- Check GitPortable Exists ---------
if not exist "%GIT_PORTABLE%" (
echo [%DATE% %TIME%] ERROR: GitPortable not found at %GIT_PORTABLE% >> "%LOG_FILE%"
echo ERROR: GitPortable not found at %GIT_PORTABLE%
pause
exit /b
)
:: --------- Handle Existing Cosmic Rage Folder ---------
if exist "%TARGET_DIR%" (
echo The target folder already exists: "%TARGET_DIR%"
echo Would you like to delete and recreate it? (Y/N)
@@ -60,6 +73,30 @@ if not exist "%TARGET_DIR%" (
)
echo [%DATE% %TIME%] Folder is ready. >> "%LOG_FILE%"
:: --------- Download sounds using partial clone + sparse checkout ---------
echo [%DATE% %TIME%] Downloading sound files using Git sparse clone... >> "%LOG_FILE%"
rd /s /q "%SOUNDS_DIR%" >nul 2>&1
"%GIT_PORTABLE%" clone --depth=1 --filter=blob:none --sparse "%REPO_URL%" "%SOUNDS_DIR%" >> "%LOG_FILE%" 2>&1
if errorlevel 1 (
echo [%DATE% %TIME%] ERROR: Git clone failed. >> "%LOG_FILE%"
echo ERROR: Failed to clone repo. Check network or GitPortable version.
pause
exit /b
)
pushd "%SOUNDS_DIR%"
"%GIT_PORTABLE%" sparse-checkout set "%REPO_SUBFOLDER%" >> "%LOG_FILE%" 2>&1
if not exist "%SOUNDS_DIR%\%REPO_SUBFOLDER%" (
echo [%DATE% %TIME%] ERROR: Failed to checkout sparse folder. >> "%LOG_FILE%"
echo ERROR: Could not pull sparse folder. Check folder name or repo.
pause
popd
exit /b
)
popd
echo [%DATE% %TIME%] Sounds successfully cloned. >> "%LOG_FILE%"
:: --------- Create cosmic rage.set ---------
if not exist "%SET_FILE%" (
echo [%DATE% %TIME%] Creating cosmic rage.set >> "%LOG_FILE%"
@@ -73,12 +110,21 @@ if not exist "%SET_FILE%" (
)
:: --------- Create loader.set ---------
if not exist "%LOADER_FILE%" (
echo [%DATE% %TIME%] Creating loader.set >> "%LOG_FILE%"
echo #Var scpath ^{%CURRENT_DIR%^/scripts} > "%LOADER_FILE%"
echo Created: loader.set
echo [%DATE% %TIME%] Creating loader.set >> "%LOG_FILE%"
(
echo #Var scpath ^{%CURRENT_DIR%^/scripts}
echo #Var sppath ^{%CURRENT_DIR%^/sounds/%REPO_SUBFOLDER%}
) > "%LOADER_FILE%"
echo Created: loader.set
:: --------- Copy settings.set ---------
if exist "%CURRENT_DIR%\scripts\settings.set" (
echo [%DATE% %TIME%] Copying settings.set >> "%LOG_FILE%"
copy "%CURRENT_DIR%\scripts\settings.set" "%TARGET_DIR%\" >nul
echo settings.set copied to target directory.
) else (
echo loader.set already exists.
echo [%DATE% %TIME%] WARNING: scripts\settings.set not found. >> "%LOG_FILE%"
echo WARNING: scripts\settings.set not found.
)
:: --------- Finish ---------