forked from joalla/discogs_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbump.sh
executable file
·32 lines (28 loc) · 814 Bytes
/
bump.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Wrapper script for bumpversion/bump2version python package.
# Requires: pip install bump2version
#
# Increments major, minor or patch part of version in configured files
# (.bumpversion.cfg). Can be savely executed to see what would be bumped. To
# really change and commit, a second cli arg "doit" has to be passed.
#set -x
PART=$1
which bump2version
if [ $? != 0 ]; then
echo "bump2version package missing."
exit 1
fi
if [ -z $1 ]; then
echo "Bumps version, commits and tags."
echo "Usage: $0 <major|minor|patch> [doit]"
exit 0
fi
if [[ "$2" == "doit" ]]; then
bumpversion $PART --verbose
echo ""
echo "All good? Then push commits and tags:"
echo "git push --follow-tags"
else
echo -e "\nTHIS IS A DRY-RUN\n"
bumpversion $PART --verbose --dry-run
fi