Simplify self_update

This commit is contained in:
Julian Ospald 2018-09-30 14:00:58 +08:00
parent bc6a15cc91
commit 6dce415077
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 1 additions and 4 deletions

5
ghcup
View File

@ -128,7 +128,6 @@ FLAGS:
ARGS: ARGS:
[TARGET-LOCATION] Where to place the updated script (defaults to ~/.local/bin). [TARGET-LOCATION] Where to place the updated script (defaults to ~/.local/bin).
Must be an absolute path!
") ")
exit 1 exit 1
} }
@ -474,7 +473,6 @@ set_ghc() {
## self-update subcommand ## ## self-update subcommand ##
# TODO: relative path
# @FUNCTION: self_update # @FUNCTION: self_update
# @USAGE: <install-location> # @USAGE: <install-location>
# @DESCRIPTION: # @DESCRIPTION:
@ -488,10 +486,9 @@ self_update() {
status_message "Updating ${SCRIPT}" status_message "Updating ${SCRIPT}"
( (
edo cd "$(mktemp -d)" edo cd "${target_location}"
edo download "${SCRIPT_UPDATE_URL}" edo download "${SCRIPT_UPDATE_URL}"
edo mv ghcup "${target_location}"/ghcup
edo chmod +x "${target_location}"/ghcup edo chmod +x "${target_location}"/ghcup
) || die "failed to install" ) || die "failed to install"