diff options
author | Helge Rausch <helge@rausch.io> | 2014-06-16 16:11:59 +0200 |
---|---|---|
committer | Helge Rausch <helge@rausch.io> | 2014-06-28 13:23:40 +0200 |
commit | 480ca2205846426c04fa46fb37e1f7246bba2b88 (patch) | |
tree | b3f0ed0673bfedaaa2aa62ee7ca2fa6c6c51ec3b /plugins | |
parent | 3913106b2e7127d396f27b652df812340ec0c871 (diff) | |
download | zsh-480ca2205846426c04fa46fb37e1f7246bba2b88.tar.gz zsh-480ca2205846426c04fa46fb37e1f7246bba2b88.tar.bz2 zsh-480ca2205846426c04fa46fb37e1f7246bba2b88.zip |
Make bundler plugin run binstubbed cmd if existing
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 3338d78be..fc20f91b3 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 |