From ea828cd13a7c462ab235d33675d7fbd28a24e6e1 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 12 Jul 2022 20:26:57 +0200 Subject: [PATCH] Fix non-interactive install on windows --- scripts/bootstrap/bootstrap-haskell | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index bdbb826..953404a 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -140,8 +140,12 @@ ecabal() { } _ecabal() { - # shellcheck disable=SC2086 - "${GHCUP_BIN}/cabal" "$@" + if [ -n "${CABAL_BIN}" ] ; then + "${CABAL_BIN}" "$@" + else + # shellcheck disable=SC2086 + "${GHCUP_BIN}/cabal" "$@" + fi } _done() { @@ -817,7 +821,7 @@ else # don't install ghc and cabal # we'll remove it afterwards tmp_dir="$(mktemp -d)" eghcup --cache install cabal -i "${tmp_dir}" "${BOOTSTRAP_HASKELL_CABAL_VERSION}" - PATH="${tmp_dir}:$PATH" do_cabal_config_init $ask_cabal_config_init_answer + CABAL_BIN="${tmp_dir}/cabal" do_cabal_config_init $ask_cabal_config_init_answer rm "${tmp_dir}/cabal" unset tmp_dir ;;