FIxing a problem caused by the strange "command command -v rbenv"

Some systems don't have a ```command``` command ; testing for it before trying to execute it is better form.
This commit is contained in:
Michel Belleville 2015-05-06 08:50:39 +02:00 committed by Michel Belleville
parent e77c6cd77a
commit fa253c22e9

View File

@ -6,11 +6,11 @@
if [ -e "$RBENV_BIN_ROOT/rbenv" ]
set rbenv_binary "$RBENV_BIN_ROOT/rbenv"
_prepend_path "$RBENV_BIN_ROOT"
else if [ (which command; and command command -v rbenv) ]
set rbenv_binary (command command -v rbenv)
else if [ -e "$HOME/.rbenv/bin/rbenv" ]
set rbenv_binary "$HOME/.rbenv/bin/rbenv"
_prepend_path "$HOME/.rbenv/bin"
else if [ (command command -v rbenv) ]
set rbenv_binary (command command -v rbenv)
else
echo "Could not find rbenv. Make sure it's on your system path, in your home directory or set the RBENV_BIN_ROOT environment variable pointing to the directory where you unpacked rbenv."
exit 1