diff options
Diffstat (limited to 'bin/mkrelease.sh')
-rwxr-xr-x | bin/mkrelease.sh | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/bin/mkrelease.sh b/bin/mkrelease.sh index 67df86d..b5de149 100755 --- a/bin/mkrelease.sh +++ b/bin/mkrelease.sh @@ -4,20 +4,51 @@ readonly BASEDIR=$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P) main() { - if [ -z "$1" ] - then - usage - exit 1 - fi + # Handle opts + opts "$@" + shift "$OPTS" + unset OPTS + # Show help + [ "$OPT_HELP_ONLY" ] && usage && exit 0 + [ -z "$1" ] && usage && exit 1 + + # Make the release cd -- "$BASEDIR" make -f tools/star/Makefile all VERSION="$1" make -f tools/star/Makefile release VERSION="$1" } +opts() +{ + OPTS=0 + + while getopts ":h" opt + do + case "$opt" in + h) OPT_HELP_ONLY=1 ;; + *) + printf "Invalid option passed: %s\n" "$OPTARG" >&2 + ;; + esac + done +} + usage() { - print "NYI\n" + cat <<EOF +Usage: + $(basename "$0") -h + $(basename "$0") <version> + +Make a releasable tarball of Rakudo Star. You must specify a version number, +which will be used to name the tarball. The tarball will be put in +$BASEDIR/work/release. You will still have to manually create checksums and a +PGP signature. + +Options: + -h Show this help text and exit. +EOF } main "$@" |