a41d308f70181db085938c5a8f2fe3d0d8e312c5

Author
Nick Fagerlund <nick@hashicorp.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

bundler: make it play nice with functions that call wrapped commands (#8271)

When another function calls one of the bundler plugin's wrapper functions, the
command to run gets passed as an array instead of a space-separated string. That
works fine when the arguments are expanded alone, like `bundle exec $@`, but
something like `./bin/$@` will expand to something like `./bin/rake
./bin/--silent ./bin/--tasks`, which of course will explode. This was causing a
nasty interaction with the rake-fast plugin, and I'd be shocked if it wasn't
causing other problems.

The fix is to explicitly turn off the `RC_EXPAND_PARAM` option for that expansion.
See http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion
for more details.

Diff

 1diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 2index c4a4fd40a56d7fcd2a476203e81020a3b0504a0a..d93fac01ed62c57ddfd4a3d305dfab826e7cc4ce 100644
 3--- a/plugins/bundler/bundler.plugin.zsh
 4+++ b/plugins/bundler/bundler.plugin.zsh
 5@@ -95,7 +95,7 @@ _binstubbed() {
 6 _run-with-bundler() {
 7   if _bundler-installed && _within-bundled-project; then
 8     if _binstubbed $1; then
 9-      ./bin/$@
10+      ./bin/${^^@}
11     else
12       bundle exec $@
13     fi