Improve the bump tool

This commit is contained in:
Cotes Chung 2021-02-26 21:16:19 +08:00
parent ac2ec585f6
commit 8ce8fc780f

View file

@ -44,7 +44,7 @@ check() {
fi fi
# ensure the current branch is 'master' # ensure the current branch is 'master'
if [[ "$(git branch --show-current)" != "master" ]]; then if [[ "$(git branch --show-current)" != "master" && manual_release == "false" ]]; then
echo "Error: This operation must be performed on the 'master' branch!" echo "Error: This operation must be performed on the 'master' branch!"
exit -1 exit -1
fi fi
@ -147,6 +147,17 @@ release() {
} }
help() {
echo "Bump new version to Chirpy project"
echo "Usage:"
echo
echo " bash /path/to/bump.sh [options]"
echo
echo "Options:"
echo " -m, --manual Manual relase, bump version only."
echo " -h, --help Print this help information."
}
main() { main() {
check check
@ -179,6 +190,10 @@ while (($#)); do
manual_release=true manual_release=true
shift shift
;; ;;
-h | --help)
help
exit 0
;;
*) *)
echo "unknown option '$opt'!" echo "unknown option '$opt'!"
exit 1 exit 1