@@ -10,7 +10,7 @@ VERSION_FILE=trustymail/__init__.py
1010
1111HELP_INFORMATION=" bump_version.sh (show|major|minor|patch|prerelease|build|finalize)"
1212
13- old_version=$( sed -n " s/^__version__ = '\ (.*\)' $/\1/p" $VERSION_FILE )
13+ old_version=$( sed -n " s/^__version__ = \" \ (.*\)\" $/\1/p" $VERSION_FILE )
1414
1515if [ $# -ne 1 ]
1616then
2020 major|minor|patch|prerelease|build)
2121 new_version=$( python -c " import semver; print(semver.bump_$1 ('$old_version '))" )
2222 echo Changing version from " $old_version " to " $new_version "
23- sed -i " s/$old_version /$new_version /" $VERSION_FILE
23+ # A temp file is used to provide compatability with macOS development
24+ # as a result of macOS using the BSD version of sed
25+ tmp_file=/tmp/version.$$
26+ sed " s/$old_version /$new_version /" $VERSION_FILE > $tmp_file
27+ mv $tmp_file $VERSION_FILE
2428 git add $VERSION_FILE
2529 git commit -m" Bump version from $old_version to $new_version "
2630 git push
2731 ;;
2832 finalize)
2933 new_version=$( python -c " import semver; print(semver.finalize_version('$old_version '))" )
3034 echo Changing version from " $old_version " to " $new_version "
31- sed -i " s/$old_version /$new_version /" $VERSION_FILE
35+ # A temp file is used to provide compatability with macOS development
36+ # as a result of macOS using the BSD version of sed
37+ tmp_file=/tmp/version.$$
38+ sed " s/$old_version /$new_version /" $VERSION_FILE > $tmp_file
39+ mv $tmp_file $VERSION_FILE
3240 git add $VERSION_FILE
33- git commit -m" Finalize version from $old_version to $new_version "
41+ git commit -m" Bump version from $old_version to $new_version "
3442 git push
3543 ;;
3644 show)
0 commit comments