Sample Header Ad - 728x90

How do I source in "/Users/<usr>/.ghcup/env" to $PATH in .zshrc after installing Haskell?

1 vote
1 answer
2170 views
I cannot seem to get the $PATH variable sourced in via /Users/chris/.ghcup/env so that I can directly use the ghc or ghci binary in zsh. I installed ghc & cabal-install via ghcup: curl https://get-ghcup.haskell.org -sSf | sh as described on https://www.haskell.org/platform/mac.html / https://www.haskell.org/ghcup/ Hint during installation process: > It will add the 'cabal', 'ghc', and 'ghcup' executables to bin directory located at: > /Users/chris/.ghcup/bin >and create the environment file /Users/chris/.ghcup/env which you should source in your ~/.bashrc or similar to get the required PATH components. > ... > In order to run ghc and cabal, you need to adjust your PATH variable. You may want to source '/Users/chris/.ghcup/env' in your shell configuration to do so (e.g. ~/.bashrc). I can get the binaries to run after adding export PATH=/Users/chris/.ghcup/bin:$PATH to ~/.zshrc. However, from the hints during installation I am assuming that I should rather use the $PATH information automatically provided in /Users/chris/.ghcup/env. Content of cat /Users/chris/.ghcup/env: > export PATH="$HOME/.cabal/bin:${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/bin:$PATH" How do I incorporate that into my .zshrc?
Asked by Christopher Graf (113 rep)
Nov 9, 2019, 04:38 PM
Last activity: Mar 30, 2021, 04:38 PM