Pārlūkot izejas kodu

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

pull/360/head^2
Sam Stephenson pirms 11 gadiem
vecāks
revīzija
283e67b57e
1 mainītis faili ar 18 papildinājumiem un 1 dzēšanām
  1. +18
    -1
      libexec/rbenv-rehash

+ 18
- 1
libexec/rbenv-rehash Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt