Simplify self_update
This commit is contained in:
parent
bc6a15cc91
commit
6dce415077
5
ghcup
5
ghcup
@ -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"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user