Permalink
Browse files

Bugfix: Improved check for no gem command.

  • Loading branch information...
wayneeseguin committed Mar 30, 2010
1 parent 283daca commit 0d99c416dc33d710e25495a6261176da66c06b58
Showing with 5 additions and 4 deletions.
  1. +2 −2 scripts/cd
  2. +1 −1 scripts/cli
  3. +2 −1 scripts/utility
View
@@ -2,13 +2,13 @@
# Source a .rvmrc file in a directory after changing to it, if it exists.
# To disable this fature, set rvm_project_rvmrc=0 in $HOME/.rvmrc
-if [[ "$rvm_project_rvmrc" != 0 ]] ; then
+if [[ "$rvm_project_rvmrc" -ne 0 ]] ; then
cd() {
builtin cd "$@"
local cwd ; cwd=$(pwd)
while : ; do
if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
- if [[ "$rvm_project_rvmrc_default" = 1 ]] ; then
+ if [[ "$rvm_project_rvmrc_default" -eq 1 ]] ; then
rvm default 1>/dev/null 2>&1
fi
break
View
@@ -3,7 +3,7 @@
__rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
__rvm_parse_args() {
- if echo "$*" | grep -q 'trace' ; then echo "$*" ; __rvm_version ; fi
+ if echo "$@" | grep -q 'trace' ; then echo "$@" ; __rvm_version ; fi
while [[ $# -gt 0 ]] ; do
rvm_token="$1" ; shift
View
@@ -638,7 +638,8 @@ __rvm_make_flags() {
# Select a gemset based on CLI set options and environment.
# This only sets 'rvm_ruby_gem_home'
__rvm_gemset_select() {
- if ! which gem > /dev/null 2>&1 ; then return 0 ; fi
+ which gem > /dev/null 2>&1
+ if [[ $? -gt 0 ]] ; then return 0 ; fi # Stop if no 'gem' command is available.
rvm_ruby_global_gems_path="$rvm_gems_path/${rvm_ruby_string}${rvm_gemset_separator}global"

0 comments on commit 0d99c41

Please sign in to comment.