Update patch files

This commit is contained in:
dazedanon 2025-07-04 19:29:29 -05:00
parent f632d6b14b
commit f4e0133c86
2 changed files with 32 additions and 2 deletions

View file

@ -93,15 +93,27 @@ if !errorlevel! neq 0 (
REM Extract contents, overwriting conflicts
echo "Extracting..."
!_my_shell! -Command "Set-Location -LiteralPath '%escaped_cd%'; Expand-Archive -Path '.\repo.zip' -DestinationPath '.' -Force"
if !errorlevel! neq 0 (
echo Extraction failed!
del repo.zip
rmdir /s /q "%repo%-%branch%"
pause
exit /b
)
echo "Applying patch..."
xcopy /s /e /y "%repo%-%branch%\*" "."
if !errorlevel! neq 0 (
echo Patch application failed!
del repo.zip
rmdir /s /q "%repo%-%branch%"
pause
exit /b
)
REM Clean up
echo "Cleaning up..."
del repo.zip
rmdir /s /q "%repo%-%branch%"
del latest_patch_sha.txt
REM Store latest SHA for next check
echo %latest_patch_sha% > previous_patch_sha.txt
endlocal

View file

@ -38,13 +38,31 @@ download_extract() {
# Download zip file
echo "Downloading latest patch..."
curl -sL "https://gitgud.io/$username/$repo/-/archive/$branch/$repo-$branch.zip" -o repo.zip
if [ $? -ne 0 ]; then
echo "Download failed!"
rm -f repo.zip
rm -rf "$repo-$branch"
return 1
fi
# Extract contents, overwriting conflicts
echo "Extracting..."
unzip -qo repo.zip
if [ $? -ne 0 ]; then
echo "Extraction failed!"
rm -f repo.zip
rm -rf "$repo-$branch"
return 1
fi
echo "Applying patch..."
cp -r "$repo-$branch/"* .
if [ $? -ne 0 ]; then
echo "Patch application failed!"
rm -f repo.zip
rm -rf "$repo-$branch"
return 1
fi
echo "Cleaning up..."
rm repo.zip