From 14463696b7504d88485018adf0d5e7b2cee66246 Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Sat, 26 May 2018 23:06:41 +0300 Subject: [PATCH] exec --no-resolve parameter introduced Allows to execute arbitrary command in the context of selected ruby. #865 --- libexec/rbenv-exec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libexec/rbenv-exec b/libexec/rbenv-exec index e05ce51..3f117e2 100755 --- a/libexec/rbenv-exec +++ b/libexec/rbenv-exec @@ -30,8 +30,16 @@ if [ -z "$RBENV_COMMAND" ]; then fi export RBENV_VERSION -RBENV_COMMAND_PATH="$(rbenv-which "$RBENV_COMMAND")" -RBENV_BIN_PATH="${RBENV_COMMAND_PATH%/*}" +if [ "$1" = "--no-resolve" ]; then + RBENV_COMMAND="$2" + RBENV_COMMAND_PATH="$RBENV_COMMAND" + RBENV_BIN_PATH="$(rbenv-prefix)/bin" + shift 1 +else + RBENV_COMMAND_PATH="$(rbenv-which "$RBENV_COMMAND")" + RBENV_BIN_PATH="${RBENV_COMMAND_PATH%/*}" +fi + OLDIFS="$IFS" IFS=$'\n' scripts=(`rbenv-hooks exec`)