From 480ca2205846426c04fa46fb37e1f7246bba2b88 Mon Sep 17 00:00:00 2001 From: Helge Rausch Date: Mon, 16 Jun 2014 16:11:59 +0200 Subject: [PATCH] Make bundler plugin run binstubbed cmd if existing --- plugins/bundler/bundler.plugin.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 3338d78b..fc20f91b 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -47,9 +47,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