Tweak ghcup upgrade
1. add --inplace flag 2. by default install into BIN_LOCATION
This commit is contained in:
parent
ae99de5876
commit
36e8389bb0
13
ghcup
13
ghcup
@ -269,10 +269,12 @@ USAGE:
|
||||
${SCRIPT} upgrade [FLAGS] [TARGET-LOCATION]
|
||||
|
||||
FLAGS:
|
||||
-i, --inplace Update this script in-place (wherever it's at)
|
||||
-h, --help Prints help information
|
||||
|
||||
ARGS:
|
||||
[TARGET-LOCATION] Where to place the updated script (defaults to directory of the script).
|
||||
[TARGET-LOCATION] Where to place the updated script (defaults to ${BIN_LOCATION}).
|
||||
This is ignored if --inplace is issued as well.
|
||||
")
|
||||
exit 1
|
||||
}
|
||||
@ -1885,18 +1887,23 @@ while [ $# -gt 0 ] ; do
|
||||
|
||||
break;;
|
||||
upgrade)
|
||||
IN_PLACE=false
|
||||
shift 1
|
||||
while [ $# -gt 0 ] ; do
|
||||
case $1 in
|
||||
-h|--help) upgrade_usage;;
|
||||
-i|--inplace) IN_PLACE=true
|
||||
shift 1 ;;
|
||||
*) TARGET_LOCATION=$1
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
if [ -n "${TARGET_LOCATION}" ] ; then
|
||||
if ${IN_PLACE} ; then
|
||||
upgrade "$(dirname "$(posix_realpath "${SOURCE}")")"
|
||||
elif [ -n "${TARGET_LOCATION}" ] ; then
|
||||
upgrade "${TARGET_LOCATION}"
|
||||
else
|
||||
upgrade "$(dirname "$(posix_realpath "${SOURCE}")")"
|
||||
upgrade "${BIN_LOCATION}"
|
||||
fi
|
||||
break;;
|
||||
show)
|
||||
|
Loading…
Reference in New Issue
Block a user