Set metadata fetching mode to strict in bootstrap script

And improve error messages.
This commit is contained in:
Julian Ospald 2023-02-01 16:44:10 +08:00
parent 3d1b8859cd
commit 69d325bf90
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F
1 changed files with 7 additions and 5 deletions

View File

@ -120,19 +120,21 @@ edo() {
}
eghcup() {
edo _eghcup "$@"
_eghcup "$@"
}
_eghcup() {
if [ -n "${BOOTSTRAP_HASKELL_YAML}" ] ; then
args="-s ${BOOTSTRAP_HASKELL_YAML}"
args="-s ${BOOTSTRAP_HASKELL_YAML} --metadata-fetching-mode=Strict"
else
args="--metadata-fetching-mode=Strict"
fi
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
# shellcheck disable=SC2086
"${GHCUP_BIN}/ghcup" ${args} "$@"
"${GHCUP_BIN}/ghcup" ${args} "$@" || die "\"ghcup ${args} $*\" failed!"
else
# shellcheck disable=SC2086
"${GHCUP_BIN}/ghcup" ${args} --verbose "$@"
"${GHCUP_BIN}/ghcup" ${args} --verbose "$@" || die "\"ghcup ${args} --verbose $*\" failed!"
fi
}
@ -147,7 +149,7 @@ _ecabal() {
}
ecabal() {
edo _ecabal "$@"
_ecabal "$@" || die "\"cabal $*\" failed!"
}
_done() {