Make stack GHC install hook posix compliant

See https://github.com/commercialhaskell/stack/issues/5888
This commit is contained in:
Julian Ospald 2022-09-30 13:27:48 +08:00
parent 156b4724f3
commit 9902adab6d
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F

View File

@ -1,13 +1,16 @@
#!/bin/bash
#!/bin/sh
# !! KEEP THIS SCRIPT POSIX COMPLIANT !!
# see https://docs.haskellstack.org/en/stable/yaml_configuration/#ghc-installation-customisation-experimental
# for documentation about hooks
set -euo pipefail
set -eu
case $HOOK_GHC_TYPE in
bindist)
echo "$(ghcup run --ghc "$HOOK_GHC_VERSION" --install)/ghc"
ghcdir=$(ghcup run --ghc "$HOOK_GHC_VERSION" --install) || exit 3
printf "%s/ghc" "${ghcdir}"
;;
git)
# TODO: should be somewhat possible