Redo ghc-install.sh, fixes #913

This commit is contained in:
Julian Ospald 2023-11-06 18:23:02 +08:00
parent 2c3148abcc
commit 6aa486594a
No known key found for this signature in database
GPG Key ID: 4275CDA6A29BED43
1 changed files with 2 additions and 2 deletions

View File

@ -9,8 +9,8 @@ set -eu
case $HOOK_GHC_TYPE in
bindist)
ghcdir=$(ghcup whereis --directory ghc "$HOOK_GHC_VERSION" || ghcup run --ghc "$HOOK_GHC_VERSION" --install) || exit 3
printf "%s/ghc" "${ghcdir}"
ghc_path=$(ghcup whereis ghc "$HOOK_GHC_VERSION" || { ghcup install ghc "$HOOK_GHC_VERSION" >/dev/null && ghcup whereis ghc "$HOOK_GHC_VERSION" ; }) || { >&2 echo "Installing $HOOK_GHC_VERSION via ghcup failed" exit 3 ;}
printf "%s" "${ghc_path}"
;;
git)
# TODO: should be somewhat possible