浏览代码

Merge pull request #2541 from puffnfresh/cabal-sandboxes-info

Add cabal_sandbox_info function
Robby Russell 11 年之前
父节点
当前提交
500cbbc79b
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      plugins/cabal/cabal.plugin.zsh

+ 11 - 0
plugins/cabal/cabal.plugin.zsh

@@ -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