Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save robertfsegal/afa5f5be8085bbad79b3b781dde04806 to your computer and use it in GitHub Desktop.

Select an option

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
@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