scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.83k stars 193 forks source link

SCM breeze will always warn if RVM is installed #186

Open kevinslin opened 9 years ago

kevinslin commented 9 years ago

The following warning will always play, even if the condition is satisfied.

SCM Breeze must be loaded after RVM, otherwise there will be a conflict when RVM wraps the 'cd' command.

Script should check if rvm has been sourced and only report warning if true.

captn3m0 commented 8 years ago

Found the error:

if [ -e "$HOME/.rvm" ] && ! type rvm > /dev/null 2>&1; then

needs to be if [ -e "$HOME/.rvm" ] && type rvm > /dev/null 2>&1; then

Because, in posix shells, return value of 0 is true:

The if compound-list shall be executed; if its exit status is zero, the then compound-list shall be executed and the command shall complete. Otherwise, each elif compound-list shall be executed, in turn, and if its exit status is zero, the then compound-list shall be executed and the command shall complete. Otherwise, the else compound-list shall be executed.

type would return 0 = true, and then the echo statements would run.