Created
May 4, 2023 17:41
-
-
Save robertfsegal/afa5f5be8085bbad79b3b781dde04806 to your computer and use it in GitHub Desktop.
Modifying the changelist in the Unreal Engine build.version in the cases where using UpateLocalVerison batch file doesn't work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| if "%WORKSPACE_UE4_DIR%" == "" ( | |
| set WORKSPACE_UE4_DIR=%WORKSPACE% | |
| ) else ( | |
| set WORKSPACE_UE4_DIR=%WORKSPACE%\%WORKSPACE_UE4_DIR% | |
| ) | |
| @echo off | |
| setlocal enabledelayedexpansion | |
| set "filename=%WORKSPACE_UE4_DIR%\Engine\Build\Build.version" | |
| set "tempfilename=%WORKSPACE_UE4_DIR%\Engine\Build\Build.version.tmp" | |
| if not exist "%filename%" ( | |
| echo Error: %filename% not found. | |
| exit /b 1 | |
| ) | |
| @echo off | |
| SETLOCAL DisableDelayedExpansion | |
| (FOR /F "usebackq delims=" %%a in (`"findstr /n ^^ %filename%"`) do ( | |
| set "var=%%a" | |
| SETLOCAL EnableDelayedExpansion | |
| set "var=!var:*:=!" | |
| echo !var! | findstr /i /c:^"\"Changelist" > nul | |
| if errorlevel 1 ( | |
| rem echo is not contained in s1 | |
| echo(!var! | |
| ) else ( | |
| echo "Changelist": %P4_CHANGELIST%, | |
| ) | |
| ENDLOCAL | |
| ) | |
| ) > %tempfilename% | |
| move /y "%tempfilename%" "%filename%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment