Last active
January 13, 2023 03:29
-
-
Save GMatrixGames/546fd19da2108ace36271666b7a8ff5f to your computer and use it in GitHub Desktop.
Updates the Unreal Engine Build.version json file using Git instead of Perforce for versioning.
This file contains 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
#!/bin/sh | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
revcount=$(git rev-list --count $branch) | |
modifiedrev=$(($revcount + 1)) | |
basename=$(basename -s .git `git config --get remote.origin.url`) | |
branch=("++$basename+$branch") | |
contents="$(jq --arg branch "$branch" --arg modifiedrev "$modifiedrev" '. + {BranchName:$branch, Changelist:$modifiedrev|tonumber}' Engine/Build/Build.version)" && \ | |
echo -E "${contents}" > Engine/Build/Build.version | |
git add Engine/Build/Build.version | |
echo "Updated Build.version to be inline with Git" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment