Repository: incubator-hivemall Updated Branches: refs/heads/master d93aac6ab -> 0b6225af4
Added --version option Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/0b6225af Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/0b6225af Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/0b6225af Branch: refs/heads/master Commit: 0b6225af460634b3516f784787ab9e9c7dc3da8f Parents: d93aac6 Author: Makoto Yui <[email protected]> Authored: Fri Jan 5 15:27:30 2018 +0900 Committer: Makoto Yui <[email protected]> Committed: Fri Jan 5 15:27:30 2018 +0900 ---------------------------------------------------------------------- bin/set_version.sh | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/0b6225af/bin/set_version.sh ---------------------------------------------------------------------- diff --git a/bin/set_version.sh b/bin/set_version.sh index 84e0335..ce9e576 100755 --- a/bin/set_version.sh +++ b/bin/set_version.sh @@ -47,25 +47,54 @@ function yes_or_no() { done } +usage() { + echo "./set_version.sh [--pom --version <ARG>]" + echo + echo "Option:" + echo " -h, --help | show usage" + echo " --version <ARG> | set version" + echo " --pom | " + echo +} + update_pom=1 for opt in "$@"; do case "${opt}" in '--pom' ) - update_pom=0; shift + update_pom=0 + shift + ;; + '--version' ) + if [[ -z "$2" ]] || [[ "$2" =~ ^-+ ]]; then + echo "$0: $1 option MUST have a version string as the argument" 1>&2 + exit 1 + fi + new_version="$2" + shift 2 + ;; + '-h'|'--help' ) + usage + exit 1 ;; esac done old_version=`cat VERSION` echo "Current version number is ${old_version}" -echo -echo "This script will update the version string of Hivemall." -echo -echo "Please input a version string (e.g., 0.4.3-rc.2)" -echo -n ">>" -read new_version -echo +if [ -z "$new_version" ]; then + echo + echo "This script will update the version string of Hivemall." + echo + echo "Please input a version string (e.g., 0.4.3-rc.2)" + echo -n ">>" + read new_version + echo +else + echo "New version number is ${new_version}" + echo +fi + #if [ $update_pom -eq 1 ]; then # echo "Do you want update pom.xml as well?"
