Forráskód Böngészése

Support Zsh

Zsh doesn't split a list of words into an iterable in the same way
Bourne shells do, by default. This patch (originally provided by @wk8 on
GitHub) fixes that by temporarily enabling the right behaviour.
Graham Ashton 9 éve
szülő
commit
a3ddc6dd0d
1 módosított fájl, 17 hozzáadás és 6 törlés
  1. 17 6
      bundler-exec.sh

+ 17 - 6
bundler-exec.sh

@@ -30,6 +30,21 @@ run-with-bundler()
     fi
     fi
 }
 }
 
 
+define-bundler-aliases()
+{
+    # Allow zsh to iterate over list of words
+    [ -n "$ZSH_VERSION" ] && setopt localoptions shwordsplit
+
+    local command
+
+    for command in $BUNDLED_COMMANDS; do
+        if [[ $command != "bundle" && $command != "gem" ]]; then
+            alias $command="run-with-bundler $command"
+        fi
+    done
+}
+
+
 ## Main program
 ## Main program
 
 
 BUNDLED_COMMANDS="${BUNDLED_COMMANDS:-
 BUNDLED_COMMANDS="${BUNDLED_COMMANDS:-
@@ -75,10 +90,6 @@ unicorn_rails
 wagon
 wagon
 }"
 }"
 
 
-for CMD in $BUNDLED_COMMANDS; do
-    if [[ $CMD != "bundle" && $CMD != "gem" ]]; then
-        alias $CMD="run-with-bundler $CMD"
-    fi
-done
+define-bundler-aliases
 
 
-unset CMD
+unset -f define-bundler-aliases