Skip to content

Commit aa1f59b

Browse files
committed
Add fixed version of bump.sh
1 parent bc6b472 commit aa1f59b

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

bump.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
#!/bin/bash
2+
# Wrapper script for bumpversion/bump2version python package.
3+
# Requires: pip install bump2version
4+
#
5+
# Increments major, minor or patch part of version in configured files
6+
# (.bumpversion.cfg). Can be savely executed to see what would be bumped. To
7+
# really change and commit, a second cli arg "doit" has to be passed.
28

39
#set -x
4-
VERS=$1
5-
DRY="echo"
10+
PART=$1
11+
12+
which bump2version
13+
if [ $? != 0 ]; then
14+
echo "bump2version package missing."
15+
exit 1
16+
fi
617

718
if [ -z $1 ]; then
8-
echo "Usage: ./bump.sh <version> [doit]"
19+
echo "Bumps version, commits and tags."
20+
echo "Usage: $0 <major|minor|patch> [doit]"
921
exit 0
1022
fi
1123

1224
if [[ "$2" == "doit" ]]; then
13-
DRY=""
25+
bumpversion $PART --verbose
26+
echo ""
27+
echo "All good? Then push commits and tags:"
28+
echo "git push --follow-tags"
1429
else
1530
echo -e "\nTHIS IS A DRY-RUN\n"
31+
bumpversion $PART --verbose --dry-run
1632
fi
17-
18-
$DRY git tag -d $VERS
19-
$DRY git push origin --delete $VERS
20-
$DRY bump2version build --new-version $VERS --commit --tag --verbose

0 commit comments

Comments
 (0)