we no longer require git portable on the folder, have a git installer bat. it will attempt to use installed git otherwhise will use portable

This commit is contained in:
Draqoken
2025-04-22 01:47:42 +03:00
parent c6eb157ad3
commit 162587be35
7414 changed files with 57 additions and 2180916 deletions

View File

@@ -5,7 +5,6 @@ setlocal
set "LOG_FILE=cosmic_setup.log"
echo [%DATE% %TIME%] Starting script... > "%LOG_FILE%"
:: --------- Define Paths ---------
set "CURRENT_DIR=%~dp0"
if "%CURRENT_DIR:~-1%"=="\" set "CURRENT_DIR=%CURRENT_DIR:~0,-1%"
@@ -22,10 +21,18 @@ 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%"
:: --------- 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%
:: --------- Determine which Git to use ---------
set "GIT_CMD="
where git >nul 2>nul
if %errorlevel%==0 (
set "GIT_CMD=git"
echo [%DATE% %TIME%] Git found in PATH. >> "%LOG_FILE%"
) else if exist "%GIT_PORTABLE%" (
set "GIT_CMD=%GIT_PORTABLE%"
echo [%DATE% %TIME%] Git not found in PATH, using GitPortable. >> "%LOG_FILE%"
) else (
echo [%DATE% %TIME%] ERROR: Git not found in PATH or at %GIT_PORTABLE% >> "%LOG_FILE%"
echo ERROR: Git not found in PATH or at %GIT_PORTABLE%
pause
exit /b
)
@@ -33,7 +40,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? Warning this may deleting existing scripts or set gags. This cannot be aborted! Please backup the folder. (Y/N)
echo Would you like to delete and recreate it? Warning: this may delete existing scripts or set gags. This cannot be undone! Please backup the folder. (Y/N)
set "userchoice="
set /p userchoice=Your choice:
if /i "%userchoice%"=="Y" (
@@ -64,25 +71,25 @@ if not exist "%TARGET_DIR%" (
)
echo [%DATE% %TIME%] Folder is ready. >> "%LOG_FILE%"
:: --------- Download sounds using partial clone + sparse checkout ---------
:: --------- Download sounds using 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%"
"%GIT_CMD%" 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.
echo ERROR: Failed to clone repo. Check network or Git version.
pause
exit /b
)
pushd "%SOUNDS_DIR%"
"%GIT_PORTABLE%" sparse-checkout set "%REPO_SUBFOLDER%"
"%GIT_CMD%" 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.
pause
popd
pause
exit /b
)
popd
@@ -117,6 +124,7 @@ 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%"