File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -eux
33
4- SCRIPT_DIR=" $( dirname " $0 " ) "
4+ SCRIPT_DIR=" $( dirname " $0 " ) "
55cd $SCRIPT_DIR /..
66
77OLD_VERSION=" ${1} "
@@ -11,9 +11,20 @@ echo "Current version: $OLD_VERSION"
1111echo " Bumping version: $NEW_VERSION "
1212
1313function replace() {
14- ! grep " $2 " $3
15- perl -i -pe " s/$1 /$2 /g" $3
16- grep " $2 " $3 # verify that replacement was successful
14+ local _path=" $3 "
15+
16+ if grep " $2 " " $_path " > /dev/null; then
17+ echo " Version already bumped to $NEW_VERSION "
18+ exit 1
19+ fi
20+
21+ perl -i -pe " s/$1 /$2 /g" " $3 "
22+
23+ # Verify that replacement was successful
24+ if ! grep " $2 " " $3 " ; then
25+ echo " Failed to bump version"
26+ exit 1
27+ fi
1728}
1829
19- replace " \@version \" [0-9.]+\" " " \@version \" $NEW_VERSION \" " ./mix.exs
30+ replace " \@version \" [0-9.rc\- ]+\" " " \@version \" $NEW_VERSION \" " ./mix.exs
You can’t perform that action at this time.
0 commit comments