Procházet zdrojové kódy

When the ruby shim is invoked with a script, set RBENV_DIR to the script's dirname

pull/360/head^2
Sam Stephenson před 11 roky
rodič
revize
283e67b57e
1 změnil soubory, kde provedl 18 přidání a 1 odebrání
  1. +18
    -1
      libexec/rbenv-rehash

+ 18
- 1
libexec/rbenv-rehash Zobrazit soubor

@ -37,8 +37,25 @@ create_prototype_shim() {
cat > "$PROTOTYPE_SHIM_PATH" <<SH
#!/usr/bin/env bash
set -e
[ -n "\$RBENV_DEBUG" ] && set -x
program="\${0##*/}"
if [ "\$program" = "ruby" ]; then
for arg; do
case "\$arg" in
-e* | -- ) break ;;
*/* )
if [ -f "\$arg" ]; then
export RBENV_DIR="\${arg%/*}"
break
fi
;;
esac
done
fi
export RBENV_ROOT="$RBENV_ROOT"
exec rbenv exec "\${0##*/}" "\$@"
exec rbenv exec "\$program" "\$@"
SH
chmod +x "$PROTOTYPE_SHIM_PATH"
}

Načítá se…
Zrušit
Uložit