nodejs-sources.sh: Add --debug flag

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2023-04-27 08:58:13 -04:00
parent 4e9436a835
commit 7fac550d3e
No known key found for this signature in database
GPG key ID: 45DB85A568286D11

View file

@ -5,6 +5,7 @@
# ARG_POSITIONAL_SINGLE([version],[Node.js release version])
# ARG_OPTIONAL_BOOLEAN([push],[],[Whether to upload to the lookaside cache],[on])
# ARG_OPTIONAL_BOOLEAN([debug],[],[Print all commands],[off])
# ARG_DEFAULTS_POS([])
# ARG_HELP([Tool to aid in Node.js packaging of new releases])
# ARGBASH_GO()
@ -35,14 +36,16 @@ _positionals=()
_arg_version=
# THE DEFAULTS INITIALIZATION - OPTIONALS
_arg_push="on"
_arg_debug="off"
print_help()
{
printf '%s\n' "Tool to aid in Node.js packaging of new releases"
printf 'Usage: %s [--(no-)push] [-h|--help] <version>\n' "$0"
printf 'Usage: %s [--(no-)push] [--(no-)debug] [-h|--help] <version>\n' "$0"
printf '\t%s\n' "<version>: Node.js release version"
printf '\t%s\n' "--push, --no-push: Whether to upload to the lookaside cache (on by default)"
printf '\t%s\n' "--debug, --no-debug: Print all commands (off by default)"
printf '\t%s\n' "-h, --help: Prints help"
}
@ -58,6 +61,10 @@ parse_commandline()
_arg_push="on"
test "${1:0:5}" = "--no-" && _arg_push="off"
;;
--no-debug|--debug)
_arg_debug="on"
test "${1:0:5}" = "--no-" && _arg_debug="off"
;;
-h|--help)
print_help
exit 0
@ -108,6 +115,10 @@ assign_positional_args 1 "${_positionals[@]}"
### END OF CODE GENERATED BY Argbash (sortof) ### ])
# [ <-- needed because of Argbash
if [ $_arg_debug = 'on' ]; then
set -x
fi
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
alias wget='wget --quiet'