Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/976'
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jan 20, 2024
2 parents e33f554 + 8d6445c commit 3ff6521
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/bootstrap/bootstrap-haskell
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,15 @@ ask_stack() {
unset stack_answer
}

find_stack_root() {
if [ -n "${STACK_ROOT}" ] ; then
echo "${STACK_ROOT}"
elif [ -n "${STACK_XDG}" ] ; then
echo "${XDG_DATA_HOME:-$HOME/.local/share}/stack"
else
echo "${HOME}/.stack"
fi
}

find_shell

Expand Down Expand Up @@ -860,8 +869,9 @@ case $ask_stack_answer in
;;
2)
(_eghcup --cache install stack) || die "Stack installation failed"
edo mkdir -p "${STACK_ROOT:-$HOME/.stack}"/hooks
hook_exe="${STACK_ROOT:-$HOME/.stack}"/hooks/ghc-install.sh
stack_root="$(find_stack_root)"
edo mkdir -p "${stack_root}"/hooks
hook_exe="${stack_root}"/hooks/ghc-install.sh
hook_url="https://www.haskell.org/ghcup/sh/hooks/stack/ghc-install.sh"

if [ -e "${hook_exe}" ] ; then
Expand Down

0 comments on commit 3ff6521

Please sign in to comment.