-
-
Save 573/34888cbbdf286ca48d96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_db() { | |
if [ -z "$CABAL_SANDBOX_CONFIG" ] | |
then | |
db="" | |
else | |
db=$(sed -nr -e 's/^package-db: (.*)/\1/p' "$CABAL_SANDBOX_CONFIG") | |
if [ $? -ne 0 ]; then exit 1; fi | |
fi | |
} | |
db_cmd() ( | |
# on zsh, switch to the POSIX emulation mode | |
emulate sh 2>/dev/null | |
get_db | |
cmd=$1 | |
shift | |
command "$cmd" ${db:+-no-user-package-db -package-db "$db"} "$@" | |
) | |
ghc() { db_cmd ghc "$@"; } | |
ghci() { db_cmd ghci "$@"; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
found here https://ro-che.info/articles/2014-03-05-cabal-sandbox-tips. And yes
cabal repl
inside a sandboxed folder does basically but not exactly the same as he states at the end of his post.