Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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.
  • Loading branch information...
commit 358b6ffcde9e3732ed08387fc176851e07c1862f 1 parent 4ce7f0a
Brian McKenna puffnfresh authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 plugins/cabal/cabal.plugin.zsh
11 plugins/cabal/cabal.plugin.zsh
View
@@ -1,3 +1,14 @@
+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
Please sign in to comment.
Something went wrong with that request. Please try again.