Fix argument that cannot be sent to bash via env

/usr/bin/env seems to have problems with arguments to bash on some
platforms. To bypass this, use set -e instead.
This commit is contained in:
Andreas Johansson 2011-08-12 11:33:45 +02:00
parent 398e963312
commit 6938692ca2
15 changed files with 32 additions and 16 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
abs_dirname() { abs_dirname() {
local cwd="$(pwd)" local cwd="$(pwd)"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
shopt -s nullglob shopt -s nullglob

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
RBENV_COMMAND="$1" RBENV_COMMAND="$1"
if [ -z "$RBENV_COMMAND" ]; then if [ -z "$RBENV_COMMAND" ]; then

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
print_set_version() { print_set_version() {
echo "<version> should be a string matching a Ruby version known by rbenv." echo "<version> should be a string matching a Ruby version known by rbenv."

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
print="" print=""
if [ "$1" = "-" ]; then if [ "$1" = "-" ]; then

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
if [ -n "$1" ]; then if [ -n "$1" ]; then
RBENV_VERSION="$1" RBENV_VERSION="$1"

View file

@ -1,8 +1,10 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
create_prototype_shim() { create_prototype_shim() {
cat > .rbenv-shim <<SH cat > .rbenv-shim <<SH
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
exec rbenv exec "\${0##*/}" "\$@" exec rbenv exec "\${0##*/}" "\$@"
SH SH
chmod +x .rbenv-shim chmod +x .rbenv-shim

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
RBENV_VERSION="$1" RBENV_VERSION="$1"
if [ -z "$RBENV_VERSION" ]; then if [ -z "$RBENV_VERSION" ]; then

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
RBENV_VERSION="$1" RBENV_VERSION="$1"
if [ -z "$RBENV_VERSION" ]; then if [ -z "$RBENV_VERSION" ]; then

View file

@ -1,3 +1,4 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
echo "$(rbenv-version-name) (set by $(rbenv-version-origin))" echo "$(rbenv-version-name) (set by $(rbenv-version-origin))"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
read_version_file() { read_version_file() {
egrep -m 1 '[^[:space:]]' "$1" egrep -m 1 '[^[:space:]]' "$1"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
find_version_file() { find_version_file() {
local root="$(pwd)" local root="$(pwd)"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
RBENV_VERSION_NAME="$(rbenv-version-name)" RBENV_VERSION_NAME="$(rbenv-version-name)"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
if [ "$1" = "--path" ]; then if [ "$1" = "--path" ]; then
print_paths="1" print_paths="1"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash -e #!/usr/bin/env bash
set -e
expand_path() { expand_path() {
local cwd="$(pwd)" local cwd="$(pwd)"