13b501adaf
If ~/Library/Haskell does not exist, fall back to ~/.cabal/bin. Ideally, we'd parse ~/.cabal/config here, but cabal does not provide an interface to get configuration settings.
21 lines
501 B
Bash
21 lines
501 B
Bash
#
|
|
# Enables local Haskell package installation.
|
|
#
|
|
# Authors:
|
|
# Sebastian Wiesner <lunaryorn@googlemail.com>
|
|
#
|
|
|
|
# Return if requirements are not found.
|
|
if (( ! $+commands[ghc] )); then
|
|
return 1
|
|
fi
|
|
|
|
# Prepend Cabal per user directories to PATH/MANPATH.
|
|
if [[ "$OSTYPE" == darwin* && -d $HOME/Library/Haskell ]]; then
|
|
path=($HOME/Library/Haskell/bin(/N) $path)
|
|
manpath=($HOME/Library/Haskell/man(/N) $manpath)
|
|
else
|
|
path=($HOME/.cabal/bin(/N) $path)
|
|
manpath=($HOME/.cabal/man(/N) $manpath)
|
|
fi
|