Skip to content

Commit

Permalink
update_version.sh: Added a script to automate version bumping.
Browse files Browse the repository at this point in the history
Fixes #205.
  • Loading branch information
icculus committed Sep 16, 2022
1 parent 2aa5d0d commit fe114a1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

if [ -z $1 ]; then
echo "USAGE: $0 <new_patch_version>" 1>&2
exit 1
fi

NEWVERSION="$1"
echo "Updating version to '1.2.$NEWVERSION' ..."

perl -w -pi -e 's/(VERSION 1\.2\.)\d+/${1}'$NEWVERSION'/;' CMakeLists.txt
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION 12\.)\d+/${1}'$NEWVERSION'/;' CMakeLists.txt
perl -w -pi -e 's/(\-current_version,12\.)\d+/${1}'$NEWVERSION'/;' src/Makefile.darwin
perl -w -pi -e 's/(libSDL\-1\.2\.so\.1\.2\.)\d+/${1}'$NEWVERSION'/;' src/Makefile.linux
perl -w -pi -e 's/(VERSION = 1\.2\.)\d+/${1}'$NEWVERSION'/;' src/Makefile.os2
perl -w -pi -e 's/(VERSION = 1\.2\.)\d+/${1}'$NEWVERSION'/;' src/Makefile.w32
perl -w -pi -e 's/(\#define SDL12_COMPAT_VERSION )\d+/${1}'$NEWVERSION'/;' src/SDL12_compat.c
perl -w -pi -e 's/(\#define SDL_PATCHLEVEL )\d+/${1}'$NEWVERSION'/;' include/SDL/SDL_version.h
perl -w -pi -e 's/(FILEVERSION 1,2,)\d+/${1}'$NEWVERSION'/;' src/version.rc
perl -w -pi -e 's/(PRODUCTVERSION 1,2,)\d+/${1}'$NEWVERSION'/;' src/version.rc
perl -w -pi -e 's/(VALUE "FileVersion", "1, 2, )\d+/${1}'$NEWVERSION'/;' src/version.rc
perl -w -pi -e 's/(VALUE "ProductVersion", "1, 2, )\d+/${1}'$NEWVERSION'/;' src/version.rc

echo "All done."
echo "Run 'git diff' and make sure this looks correct before 'git commit'."

exit 0

0 comments on commit fe114a1

Please sign in to comment.