浏览代码

Hook into rbenv

Matt Campbell 13 年之前
父节点
当前提交
987a23f58a
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16 0
      bundler-exec.sh

+ 16 - 0
bundler-exec.sh

@@ -1,5 +1,15 @@
 #!/bin/bash
 
+rbenv-installed()
+{
+  which rbenv > /dev/null 2>&1
+}
+
+
+if rbenv-installed; then
+  BUNDLED_COMMANDS=$(ls ~/.rbenv/shims)
+else
+
 BUNDLED_COMMANDS="${BUNDLED_COMMANDS:-
 cap
 capify
@@ -30,11 +40,17 @@ unicorn
 unicorn_rails
 }"
 
+fi
+
 ## Functions
 
 bundler-installed()
 {
+  if rbenv-installed; then
+    rbenv which bundle > /dev/null 2>&1
+  else
     which bundle > /dev/null 2>&1
+  fi
 }
 
 within-bundled-project()