From 6aa486594a5a1ebd41490a6832a75ade0e33007d Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 6 Nov 2023 18:23:02 +0800 Subject: [PATCH] Redo ghc-install.sh, fixes #913 --- scripts/hooks/stack/ghc-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/hooks/stack/ghc-install.sh b/scripts/hooks/stack/ghc-install.sh index 95d89a5..5cee123 100644 --- a/scripts/hooks/stack/ghc-install.sh +++ b/scripts/hooks/stack/ghc-install.sh @@ -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