updated gaging functions

This commit is contained in:
Draqoken
2025-04-12 17:40:29 +03:00
parent badec2993e
commit 4f56462ea1
3 changed files with 61 additions and 49 deletions

View File

@@ -5,15 +5,6 @@ setlocal
set "LOG_FILE=cosmic_setup.log"
echo [%DATE% %TIME%] Starting script... > "%LOG_FILE%"
:: --------- Admin Check ---------
net session >nul 2>&1
if %errorlevel% neq 0 (
echo You must run this script as Administrator!
echo [%DATE% %TIME%] ERROR: Script not run as administrator. >> "%LOG_FILE%"
pause
exit /b
)
echo [%DATE% %TIME%] Admin check passed. >> "%LOG_FILE%"
:: --------- Define Paths ---------
set "CURRENT_DIR=%~dp0"
@@ -42,7 +33,7 @@ if not exist "%GIT_PORTABLE%" (
:: --------- 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)
echo Would you like to delete and recreate it? Warning this may deleting existing scripts or set gags. This cannot be aborted! Please backup the folder. (Y/N)
set "userchoice="
set /p userchoice=Your choice:
if /i "%userchoice%"=="Y" (
@@ -77,7 +68,7 @@ echo [%DATE% %TIME%] Folder is ready. >> "%LOG_FILE%"
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
"%GIT_PORTABLE%" clone --depth=1 --filter=blob:none --sparse "%REPO_URL%" "%SOUNDS_DIR%"
if errorlevel 1 (
echo [%DATE% %TIME%] ERROR: Git clone failed. >> "%LOG_FILE%"
echo ERROR: Failed to clone repo. Check network or GitPortable version.
@@ -86,7 +77,7 @@ if errorlevel 1 (
)
pushd "%SOUNDS_DIR%"
"%GIT_PORTABLE%" sparse-checkout set "%REPO_SUBFOLDER%" >> "%LOG_FILE%" 2>&1
"%GIT_PORTABLE%" sparse-checkout set "%REPO_SUBFOLDER%"
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.
@@ -126,6 +117,15 @@ if exist "%CURRENT_DIR%\scripts\settings.set" (
echo [%DATE% %TIME%] WARNING: scripts\settings.set not found. >> "%LOG_FILE%"
echo WARNING: scripts\settings.set not found.
)
:: --------- Copy gags folder ---------
if exist "%CURRENT_DIR%\scripts\gags" (
echo [%DATE% %TIME%] Copying gags folder >> "%LOG_FILE%"
xcopy /E /I /Y "%CURRENT_DIR%\scripts\gags" "%TARGET_DIR%\gags" >nul
echo gags folder copied to target directory.
) else (
echo [%DATE% %TIME%] WARNING: scripts\gags folder not found. >> "%LOG_FILE%"
echo WARNING: scripts\gags folder not found.
)
:: --------- Finish ---------
echo [%DATE% %TIME%] Script completed successfully. >> "%LOG_FILE%"