Make sure we source ghcup dirs in bootstrap script

Fixes #354
This commit is contained in:
Julian Ospald 2022-04-29 15:53:28 +02:00
parent 9ad1f7cb97
commit 9daca301a0
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F

View File

@ -126,10 +126,10 @@ _eghcup() {
fi
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
# shellcheck disable=SC2086
"${GHCUP_BIN}/ghcup" ${args} "$@"
"ghcup" ${args} "$@"
else
# shellcheck disable=SC2086
"${GHCUP_BIN}/ghcup" ${args} --verbose "$@"
"ghcup" ${args} --verbose "$@"
fi
}
@ -228,7 +228,7 @@ posix_realpath() {
}
download_ghcup() {
if ! command -V "ghcup" >/dev/null 2>&1 ; then
case "${plat}" in
"linux"|"Linux")
case "${arch}" in
@ -321,6 +321,7 @@ download_ghcup() {
edo chmod +x "${GHCUP_BIN}"/ghcup
;;
esac
fi
edo mkdir -p "${GHCUP_DIR}"
@ -344,7 +345,9 @@ download_ghcup() {
# shellcheck disable=SC1090
edo . "${GHCUP_DIR}"/env
eghcup upgrade
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
ghcup upgrade || yellow "Failed to upgrade ghcup, continuing anyway"
fi
}
# Figures out the users login shell and sets
@ -733,13 +736,7 @@ fi
edo mkdir -p "${GHCUP_BIN}"
if command -V "ghcup" >/dev/null 2>&1 ; then
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
_eghcup upgrade || download_ghcup
fi
else
download_ghcup
fi
echo
if [ -n "${BOOTSTRAP_HASKELL_YAML}" ] ; then (>&2 ghcup -s "${BOOTSTRAP_HASKELL_YAML}" tool-requirements) ; else (>&2 ghcup tool-requirements) ; fi