|
|
@ -1,4 +1,18 @@ |
|
|
#!/usr/bin/env bash |
|
|
#!/usr/bin/env bash |
|
|
|
|
|
# |
|
|
|
|
|
# Summary: Run an executable with the right Ruby version |
|
|
|
|
|
# |
|
|
|
|
|
# Usage: rbenv exec COMMAND [arg1 arg2...] |
|
|
|
|
|
# |
|
|
|
|
|
# Runs an executable by first preparing PATH so that the selected Ruby version |
|
|
|
|
|
# is prepended to it. |
|
|
|
|
|
# |
|
|
|
|
|
# For example, doing: |
|
|
|
|
|
# RBENV_VERSION=1.9.3-p327 rbenv exec bundle install |
|
|
|
|
|
# |
|
|
|
|
|
# has an effect is if this was done: |
|
|
|
|
|
# PATH=~/.rbenv/versions/1.9.3-p327:"$PATH" bundle install |
|
|
|
|
|
|
|
|
set -e |
|
|
set -e |
|
|
[ -n "$RBENV_DEBUG" ] && set -x |
|
|
[ -n "$RBENV_DEBUG" ] && set -x |
|
|
|
|
|
|
|
|
@ -11,7 +25,7 @@ export RBENV_VERSION="$(rbenv-version-name)" |
|
|
RBENV_COMMAND="$1" |
|
|
RBENV_COMMAND="$1" |
|
|
|
|
|
|
|
|
if [ -z "$RBENV_COMMAND" ]; then |
|
|
if [ -z "$RBENV_COMMAND" ]; then |
|
|
echo "usage: rbenv exec COMMAND [arg1 arg2...]" >&2 |
|
|
|
|
|
|
|
|
rbenv-help --usage exec >&2 |
|
|
exit 1 |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|