mirror of
https://src.fedoraproject.org/rpms/nodejs18.git
synced 2024-11-24 09:42:43 +00:00
nodejs-sources.sh: Add --debug flag
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
parent
4e9436a835
commit
7fac550d3e
1 changed files with 12 additions and 1 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue