summaryrefslogtreecommitdiff
path: root/plugins/bundler/bundler.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/bundler/bundler.plugin.zsh')
-rw-r--r--plugins/bundler/bundler.plugin.zsh10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index 20931dcef..fbdbc0244 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/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