@echo off setlocal enabledelayedexpansion REM Check if patch-config.txt exists if not exist patch-config.txt ( echo "Config file (patch-config.txt) not found! Assuming no patching needed." exit /b ) REM Read configuration from file for /f "tokens=1,2 delims==" %%a in (patch-config.txt) do ( if "%%a"=="username" set "username=%%b" if "%%a"=="repo" set "repo=%%b" if "%%a"=="branch" set "branch=%%b" ) REM Get the latest hash echo "Getting latest commit SHA hash" powershell -Command "(Invoke-WebRequest -Uri 'https://api.github.com/repos/%username%/%repo%/branches/%branch%').Content | ConvertFrom-Json | Select-Object -ExpandProperty commit | Select-Object -ExpandProperty sha" > latest_patch_sha.txt REM Read the latest SHA from the file set /p latest_patch_sha= previous_patch_sha.txt endlocal exit /b