Переглянути джерело

Only shift if an argument is passed. Fixes #78.

pull/360/head^2
Sam Stephenson 15 роки тому
джерело
коміт
fb6eee26d4
1 змінених файлів з 8 додано та 5 видалено
  1. +8
    -5
      libexec/rbenv-init

+ 8
- 5
libexec/rbenv-init Переглянути файл

@ -70,14 +70,17 @@ echo 'rbenv rehash 2>/dev/null'
commands=(`rbenv commands --sh`)
IFS="|"
cat <<EOS
function rbenv () {
command="\$1";
shift;
function rbenv() {
command="\$1"
if [ "\$#" -gt 0 ]; then
shift
fi
case "\$command" in
${commands[*]})
eval \`rbenv "sh-\$command" "\$@"\`;;
*)
command rbenv "\$command" "\$@";;
esac;
};
esac
}
EOS

Завантаження…
Відмінити
Зберегти