configures_cabal_to_use_sandbox.sh 438 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
. ../common.sh

cabal sandbox delete > /dev/null
cabal exec my-executable && die "Unexpectedly found executable"

cabal sandbox init > /dev/null
cabal install > /dev/null

# The library should not be available outside the sandbox
$GHC_PKG list | grep -v "my-0.1"

# When run inside 'cabal-exec' the 'sandbox hc-pkg list' sub-command
# should find the library.
Oleg Grenrus's avatar
Oleg Grenrus committed
14
cabal exec sh -- -c 'cd subdir && $CABAL sandbox hc-pkg list' | grep "my-0.1"