Commit 358b6ffc authored by Brian McKenna's avatar Brian McKenna
Browse files

Add cabal_sandbox_info function

Reports whether the current working directory is within a
sandbox. Useful to check before installing Cabal packages into the
global registry.
parent 4ce7f0a3
function cabal_sandbox_info() {
cabal_files=(*.cabal(N))
if [ $#cabal_files -gt 0 ]; then
if [ -f cabal.sandbox.config ]; then
echo "%{$fg[green]%}sandboxed%{$reset_color%}"
else
echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
fi
fi
}
function _cabal_commands() {
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment