From ad2c605d3f4c4f6857157175c0ef674cd4457c13 Mon Sep 17 00:00:00 2001 From: Peter Aronoff Date: Tue, 2 Aug 2011 19:11:41 -0400 Subject: [PATCH 1/4] Use /usr/bin/env rather than /bin/bash --- bin/rbenv | 2 +- bin/rbenv-exec | 2 +- bin/rbenv-path | 2 +- bin/rbenv-rehash | 2 +- bin/rbenv-set-default | 2 +- bin/rbenv-set-local | 2 +- bin/rbenv-shim | 2 +- bin/rbenv-version | 2 +- bin/rbenv-versions | 2 +- bin/rbenv-which | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/rbenv b/bin/rbenv index 30f1a189..11e9bdc3 100755 --- a/bin/rbenv +++ b/bin/rbenv @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e command="$1" if [ -z "$command" ]; then diff --git a/bin/rbenv-exec b/bin/rbenv-exec index 16039d85..ffd911b9 100755 --- a/bin/rbenv-exec +++ b/bin/rbenv-exec @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e RBENV_COMMAND="$1" if [ -z "$RBENV_COMMAND" ]; then diff --git a/bin/rbenv-path b/bin/rbenv-path index a37c9edc..a60c806b 100755 --- a/bin/rbenv-path +++ b/bin/rbenv-path @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e if [ -n "$1" ]; then RBENV_VERSION="$1" diff --git a/bin/rbenv-rehash b/bin/rbenv-rehash index 8bbd53b6..854bd050 100755 --- a/bin/rbenv-rehash +++ b/bin/rbenv-rehash @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e mkdir -p "${HOME}/.rbenv/shims" cd "${HOME}/.rbenv/shims" diff --git a/bin/rbenv-set-default b/bin/rbenv-set-default index a36f2319..a1922a76 100755 --- a/bin/rbenv-set-default +++ b/bin/rbenv-set-default @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e RBENV_VERSION="$1" if [ -z "$RBENV_VERSION" ]; then diff --git a/bin/rbenv-set-local b/bin/rbenv-set-local index 59512db1..38406232 100755 --- a/bin/rbenv-set-local +++ b/bin/rbenv-set-local @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e RBENV_VERSION="$1" if [ -z "$RBENV_VERSION" ]; then diff --git a/bin/rbenv-shim b/bin/rbenv-shim index 0acca18f..1c0bc525 100755 --- a/bin/rbenv-shim +++ b/bin/rbenv-shim @@ -1,3 +1,3 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e exec rbenv-exec "${0##*/}" "$@" diff --git a/bin/rbenv-version b/bin/rbenv-version index 1337e367..01c1afdf 100755 --- a/bin/rbenv-version +++ b/bin/rbenv-version @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e read_version_file() { egrep -m 1 '[^[:space:]]' "$1" diff --git a/bin/rbenv-versions b/bin/rbenv-versions index b3faad6f..6b848c07 100755 --- a/bin/rbenv-versions +++ b/bin/rbenv-versions @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e RBENV_VERSION="$(rbenv-version)" diff --git a/bin/rbenv-which b/bin/rbenv-which index cb63d8d5..0e05c81b 100755 --- a/bin/rbenv-which +++ b/bin/rbenv-which @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e RBENV_VERSION="$(rbenv-version)" RBENV_COMMAND="$1" From 06228d3583e24b5057516f357f7d0ae802153007 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 2 Aug 2011 18:50:44 -0500 Subject: [PATCH 2/4] Copies bins into shims/ instead of symlinking Fixes #6 --- bin/rbenv-rehash | 7 ++++++- bin/rbenv-shim | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) delete mode 100755 bin/rbenv-shim diff --git a/bin/rbenv-rehash b/bin/rbenv-rehash index 8bbd53b6..7344a687 100755 --- a/bin/rbenv-rehash +++ b/bin/rbenv-rehash @@ -5,5 +5,10 @@ cd "${HOME}/.rbenv/shims" rm -f * for file in ../versions/*/bin/*; do - ln -fs ../bin/rbenv-shim "${file##*/}" + shim="${file##*/}" + cat > "$shim" < Date: Tue, 2 Aug 2011 18:55:14 -0500 Subject: [PATCH 3/4] Use $shim var --- bin/rbenv-rehash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/rbenv-rehash b/bin/rbenv-rehash index 7344a687..7f1e9918 100755 --- a/bin/rbenv-rehash +++ b/bin/rbenv-rehash @@ -8,7 +8,7 @@ for file in ../versions/*/bin/*; do shim="${file##*/}" cat > "$shim" < Date: Tue, 2 Aug 2011 19:37:18 -0500 Subject: [PATCH 4/4] Quote `$@` --- bin/rbenv-rehash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 bin/rbenv-rehash diff --git a/bin/rbenv-rehash b/bin/rbenv-rehash old mode 100755 new mode 100644 index 7f1e9918..1d42bce9 --- a/bin/rbenv-rehash +++ b/bin/rbenv-rehash @@ -8,7 +8,7 @@ for file in ../versions/*/bin/*; do shim="${file##*/}" cat > "$shim" <