ghcup-hs/.github/scripts/cabal-cache.sh

21 lines
391 B
Bash
Raw Normal View History

2023-07-07 14:36:09 +00:00
#!/usr/bin/env bash
case "$(uname -s)" in
MSYS_*|MINGW*)
ext=".exe"
;;
*)
ext=""
;;
esac
if [ "${CABAL_CACHE_DISABLE}" = "yes" ] ; then
echo "cabal-cache disabled (CABAL_CACHE_DISABLE set)"
elif [ "${CABAL_CACHE_NONFATAL}" = "yes" ] ; then
time "cabal-cache${ext}" "$@" || echo "cabal-cache failed (CABAL_CACHE_NONFATAL set)"
else
time "cabal-cache${ext}" "$@"
exit $?
fi