浏览代码

Merge pull request #2885 from tsujigiri/bundler/run_binstubbed

Make bundler plugin run binstubbed cmd if existing
Robby Russell 9 年之前
父节点
当前提交
c925aabea9
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      plugins/bundler/bundler.plugin.zsh

+ 9 - 1
plugins/bundler/bundler.plugin.zsh

@@ -48,9 +48,17 @@ _within-bundled-project() {
   false
 }
 
+_binstubbed() {
+  [ -f "./bin/${1}" ]
+}
+
 _run-with-bundler() {
   if _bundler-installed && _within-bundled-project; then
-    bundle exec $@
+    if _binstubbed $1; then
+      bundle exec "./bin/$@"
+    else
+      bundle exec $@
+    fi
   else
     $@
   fi