Skip to content

Commit

Permalink
Prepend $PATH with the command's dirname before execing for compatibi…
Browse files Browse the repository at this point in the history
…lity with ruby -S
  • Loading branch information
sstephenson committed Aug 5, 2011
1 parent 2fa7432 commit 2a495dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libexec/rbenv-exec
Expand Up @@ -7,6 +7,7 @@ if [ -z "$RBENV_COMMAND" ]; then
fi

RBENV_COMMAND_PATH="$(rbenv-which "$RBENV_COMMAND")"
RBENV_BIN_PATH="${RBENV_COMMAND_PATH%/*}"

shopt -s nullglob
RBENV_EXEC_PLUGINS=(/etc/rbenv.d/exec/*.bash ${HOME}/.rbenv/rbenv.d/exec/*.bash)
Expand All @@ -17,4 +18,5 @@ for script in ${RBENV_EXEC_PLUGINS[@]}; do
done

shift 1
export PATH="${RBENV_BIN_PATH}:${PATH}"
exec -a "$RBENV_COMMAND" "$RBENV_COMMAND_PATH" "$@"

0 comments on commit 2a495dc

Please sign in to comment.