Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Merge abe63fd into 4e041e5
Browse files Browse the repository at this point in the history
  • Loading branch information
jsf9k committed Sep 13, 2022
2 parents 4e041e5 + abe63fd commit 5eeea6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ VERSION_FILE=eal/_version.py
HELP_INFORMATION="bump_version.sh (show|major|minor|patch|prerelease|build|finalize)"

old_version=$(sed -n "s/^__version__ = \"\(.*\)\"$/\1/p" $VERSION_FILE)
# Comment out periods so they are interpreted as periods and don't
# just match any character
old_version_regex=${old_version//\./\\\.}

if [ $# -ne 1 ]; then
echo "$HELP_INFORMATION"
Expand All @@ -22,7 +25,7 @@ else
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
sed "s/$old_version_regex/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
Expand All @@ -34,10 +37,10 @@ else
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
sed "s/$old_version_regex/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git commit -m"Finalize version from $old_version to $new_version"
git push
;;
show)
Expand Down

0 comments on commit 5eeea6e

Please sign in to comment.