1
0
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:
Mislav Marohnić
2013-10-29 18:53:33 -07:00
3 changed files with 275 additions and 37 deletions

View File

@@ -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"
}