File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ VERSION_FILE=src/version.txt
1111HELP_INFORMATION=" bump_version.sh (show|major|minor|patch|prerelease|build|finalize)"
1212
1313old_version=$( sed -n " s/^__version__ = \" \(.*\)\" $/\1/p" $VERSION_FILE )
14+ # Comment out periods so they are interpreted as periods and don't
15+ # just match any character
16+ old_version_regex=${old_version// \. / \\\. }
1417
1518if [ $# -ne 1 ]; then
1619 echo " $HELP_INFORMATION "
2225 # A temp file is used to provide compatability with macOS development
2326 # as a result of macOS using the BSD version of sed
2427 tmp_file=/tmp/version.$$
25- sed " s/$old_version /$new_version /" $VERSION_FILE > $tmp_file
28+ sed " s/$old_version_regex /$new_version /" $VERSION_FILE > $tmp_file
2629 mv $tmp_file $VERSION_FILE
2730 git add $VERSION_FILE
2831 git commit -m" Bump version from $old_version to $new_version "
3437 # A temp file is used to provide compatability with macOS development
3538 # as a result of macOS using the BSD version of sed
3639 tmp_file=/tmp/version.$$
37- sed " s/$old_version /$new_version /" $VERSION_FILE > $tmp_file
40+ sed " s/$old_version_regex /$new_version /" $VERSION_FILE > $tmp_file
3841 mv $tmp_file $VERSION_FILE
3942 git add $VERSION_FILE
40- git commit -m" Bump version from $old_version to $new_version "
43+ git commit -m" Finalize version from $old_version to $new_version "
4144 git push
4245 ;;
4346 show)
You can’t perform that action at this time.
0 commit comments