mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-13 05:43:53 -05:00
Merge pull request #372 from sstephenson/exec-next
Change `exec` semantics to allow using rbenv from a ruby process
This commit is contained in:
@@ -45,10 +45,12 @@ create_prototype_shim() {
|
||||
set -e
|
||||
[ -n "\$RBENV_DEBUG" ] && set -x
|
||||
|
||||
opt=""
|
||||
program="\${0##*/}"
|
||||
if [ "\$program" = "ruby" ]; then
|
||||
for arg; do
|
||||
case "\$arg" in
|
||||
-S* ) opt=--rubypath ;;
|
||||
-e* | -- ) break ;;
|
||||
*/* )
|
||||
if [ -f "\$arg" ]; then
|
||||
@@ -61,7 +63,7 @@ if [ "\$program" = "ruby" ]; then
|
||||
fi
|
||||
|
||||
export RBENV_ROOT="$RBENV_ROOT"
|
||||
exec "$(command -v rbenv)" exec "\$program" "\$@"
|
||||
exec "$(command -v rbenv)" exec \$opt "\$program" "\$@"
|
||||
SH
|
||||
chmod +x "$PROTOTYPE_SHIM_PATH"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user