mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-01 22:43:38 +02:00
Fixes application name on -t
& -h
and (still) improves exit
calls
This commit is contained in:
parent
82a04a1734
commit
0e481b078e
1 changed files with 10 additions and 3 deletions
13
updater.sh
13
updater.sh
|
@ -29,6 +29,7 @@ CYAN='\033[0;36m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Argument defaults
|
# Argument defaults
|
||||||
|
SHOW_USAGE=false
|
||||||
UPDATE='check'
|
UPDATE='check'
|
||||||
CONFIRM='yes'
|
CONFIRM='yes'
|
||||||
OVERRIDE='user-overrides.js'
|
OVERRIDE='user-overrides.js'
|
||||||
|
@ -105,7 +106,6 @@ usage() {
|
||||||
echo -e "\t-donotupdate,\t Use instead -d"
|
echo -e "\t-donotupdate,\t Use instead -d"
|
||||||
echo -e "\t-update,\t Use instead -u"
|
echo -e "\t-update,\t Use instead -u"
|
||||||
echo -e
|
echo -e
|
||||||
exit 2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
legacy_argument () {
|
legacy_argument () {
|
||||||
|
@ -241,7 +241,7 @@ update_updater () {
|
||||||
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
|
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
|
||||||
chmod u+x "${SCRIPT_DIR}/updater.sh"
|
chmod u+x "${SCRIPT_DIR}/updater.sh"
|
||||||
"${SCRIPT_DIR}/updater.sh" "$@" -d
|
"${SCRIPT_DIR}/updater.sh" "$@" -d
|
||||||
exit 0
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -374,6 +374,7 @@ if [ $# != 0 ]; then
|
||||||
# Display usage if first argument is -help or --help
|
# Display usage if first argument is -help or --help
|
||||||
if [ $1 = '--help' ] || [ $1 = '-help' ]; then
|
if [ $1 = '--help' ] || [ $1 = '-help' ]; then
|
||||||
usage
|
usage
|
||||||
|
exit
|
||||||
elif [ $legacy_lc = '-donotupdate' ]; then
|
elif [ $legacy_lc = '-donotupdate' ]; then
|
||||||
UPDATE='no'
|
UPDATE='no'
|
||||||
legacy_argument $1
|
legacy_argument $1
|
||||||
|
@ -384,7 +385,7 @@ if [ $# != 0 ]; then
|
||||||
while getopts ":hp:ludsno:bcvetr" opt; do
|
while getopts ":hp:ludsno:bcvetr" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h)
|
h)
|
||||||
usage
|
SHOW_USAGE=true
|
||||||
;;
|
;;
|
||||||
p)
|
p)
|
||||||
PROFILE_PATH=${OPTARG}
|
PROFILE_PATH=${OPTARG}
|
||||||
|
@ -429,6 +430,7 @@ if [ $# != 0 ]; then
|
||||||
\?)
|
\?)
|
||||||
echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2
|
echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2
|
||||||
usage
|
usage
|
||||||
|
exit 2
|
||||||
;;
|
;;
|
||||||
:)
|
:)
|
||||||
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
|
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
|
||||||
|
@ -439,6 +441,11 @@ if [ $# != 0 ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$SHOW_USAGE" = true ]]; then
|
||||||
|
usage
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
show_banner
|
show_banner
|
||||||
update_updater $@
|
update_updater $@
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue