mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bashscript update (#4552)
* fix wget command in Readme Fixes https://github.com/inventree/InvenTree/issues/4548 reported by @liuqun * change doc links int markdown * update bash script * Add typing * regenerate script * fix link to contribute * update more links * update bash script * revert changes
This commit is contained in:
parent
c28c991591
commit
478fec4a4b
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# This script was generated by bashly 0.8.9 (https://bashly.dannyb.co)
|
# This script was generated by bashly 0.9.4 (https://bashly.dannyb.co)
|
||||||
# Modifying it manually is not recommended
|
# Modifying it manually is not recommended
|
||||||
|
|
||||||
if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then
|
if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then
|
||||||
@ -149,44 +149,44 @@ install.sh_usage() {
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Usage:\n"
|
printf "%s\n" "Usage:"
|
||||||
printf " install.sh [SOURCE] [PUBLISHER] [OPTIONS]\n"
|
printf " install.sh [SOURCE] [PUBLISHER] [OPTIONS]\n"
|
||||||
printf " install.sh --help | -h\n"
|
printf " install.sh --help | -h\n"
|
||||||
printf " install.sh --version | -v\n"
|
printf " install.sh --version | -v\n"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [[ -n $long_usage ]]; then
|
if [[ -n $long_usage ]]; then
|
||||||
printf "Options:\n"
|
printf "%s\n" "Options:"
|
||||||
|
|
||||||
echo " --help, -h"
|
printf " %s\n" "--help, -h"
|
||||||
printf " Show this help\n"
|
printf " Show this help\n"
|
||||||
echo
|
echo
|
||||||
echo " --version, -v"
|
printf " %s\n" "--version, -v"
|
||||||
printf " Show version number\n"
|
printf " Show version number\n"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo " --no-call, -n"
|
printf " %s\n" "--no-call, -n"
|
||||||
printf " Do not call outside APIs (only functionally needed)\n"
|
printf " Do not call outside APIs (only functionally needed)\n"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo " --dry-run, -d"
|
printf " %s\n" "--dry-run, -d"
|
||||||
printf " Dry run (do not install anything)\n"
|
printf " Dry run (do not install anything)\n"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
printf "Arguments:\n"
|
printf "%s\n" "Arguments:"
|
||||||
|
|
||||||
echo " SOURCE"
|
printf " %s\n" "SOURCE"
|
||||||
printf " Package source that should be used\n"
|
printf " Package source that should be used\n"
|
||||||
printf " Allowed: stable, master, main\n"
|
printf " Allowed: stable, master, main\n"
|
||||||
printf " Default: stable\n"
|
printf " Default: stable\n"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo " PUBLISHER"
|
printf " %s\n" "PUBLISHER"
|
||||||
printf " Publisher that should be used\n"
|
printf " Publisher that should be used\n"
|
||||||
printf " Default: inventree\n"
|
printf " Default: inventree\n"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
printf "Examples:\n"
|
printf "%s\n" "Examples:"
|
||||||
printf " install\n"
|
printf " install\n"
|
||||||
printf " install master --no-call\n"
|
printf " install master --no-call\n"
|
||||||
printf " install master matmair --dry-run\n"
|
printf " install master matmair --dry-run\n"
|
||||||
@ -240,6 +240,7 @@ inspect_args() {
|
|||||||
|
|
||||||
parse_requirements() {
|
parse_requirements() {
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
case "${1:-}" in
|
case "${1:-}" in
|
||||||
--version | -v)
|
--version | -v)
|
||||||
version_command
|
version_command
|
||||||
@ -252,7 +253,12 @@ parse_requirements() {
|
|||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
action="root"
|
action="root"
|
||||||
|
|
||||||
@ -262,13 +268,13 @@ parse_requirements() {
|
|||||||
|
|
||||||
--no-call | -n)
|
--no-call | -n)
|
||||||
|
|
||||||
args[--no-call]=1
|
args['--no-call']=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--dry-run | -d)
|
--dry-run | -d)
|
||||||
|
|
||||||
args[--dry-run]=1
|
args['--dry-run']=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -279,13 +285,13 @@ parse_requirements() {
|
|||||||
|
|
||||||
*)
|
*)
|
||||||
|
|
||||||
if [[ -z ${args[source]+x} ]]; then
|
if [[ -z ${args['source']+x} ]]; then
|
||||||
|
|
||||||
args[source]=$1
|
args['source']=$1
|
||||||
shift
|
shift
|
||||||
elif [[ -z ${args[publisher]+x} ]]; then
|
elif [[ -z ${args['publisher']+x} ]]; then
|
||||||
|
|
||||||
args[publisher]=$1
|
args['publisher']=$1
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
printf "invalid argument: %s\n" "$key" >&2
|
printf "invalid argument: %s\n" "$key" >&2
|
||||||
@ -297,10 +303,10 @@ parse_requirements() {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ -n ${args[source]:-} ]] || args[source]="stable"
|
[[ -n ${args['source']:-} ]] || args['source']="stable"
|
||||||
[[ -n ${args[publisher]:-} ]] || args[publisher]="inventree"
|
[[ -n ${args['publisher']:-} ]] || args['publisher']="inventree"
|
||||||
|
|
||||||
if [[ ! ${args[source]} =~ ^(stable|master|main)$ ]]; then
|
if [[ ! ${args['source']} =~ ^(stable|master|main)$ ]]; then
|
||||||
printf "%s\n" "source must be one of: stable, master, main" >&2
|
printf "%s\n" "source must be one of: stable, master, main" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -322,9 +328,12 @@ run() {
|
|||||||
normalize_input "$@"
|
normalize_input "$@"
|
||||||
parse_requirements "${input[@]}"
|
parse_requirements "${input[@]}"
|
||||||
|
|
||||||
if [[ $action == "root" ]]; then
|
case "$action" in
|
||||||
|
"root")
|
||||||
root_command
|
root_command
|
||||||
fi
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize
|
initialize
|
||||||
|
Loading…
Reference in New Issue
Block a user