Skip to content

Commit

Permalink
Bugfix: silence another which ruby call and also test for executable …
Browse files Browse the repository at this point in the history
…on system ruby.
  • Loading branch information
wayneeseguin committed Dec 14, 2009
1 parent c400533 commit 899df15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/utility
Expand Up @@ -313,8 +313,8 @@ __rvm_list() {
fi

system_ruby="$(rvm system ; which ruby 2>/dev/null)"
if [[ ! -z "$system_ruby" ]] ; then
system_version=$(file $(which ruby) | awk -F: '{print $2}' | grep 8 | awk '{print $NF}' | tr "\n" ' ')
if [[ ! -z "$system_ruby" ]] && [[ -x "$system_ruby" ]]; then
system_version=$(file $system_ruby | awk -F: '{print $2}' | grep 8 | awk '{print $NF}' | tr "\n" ' ')
if [[ ! -z "$(which ruby 2>/dev/null)" ]] && [[ "$($(which ruby 2>/dev/null) -v)" = "$system_version" ]] ; then
echo -e "=> $(tput setaf 2)system$(tput sgr0) [$system_version]\n"
else
Expand Down Expand Up @@ -357,7 +357,7 @@ __rvm_update_rvm() {
mkdir -p "$rvm_src_path"
__rvm_pushpop "$rvm_src_path"

ruby="$(which ruby)"
ruby="$(which ruby 2>/dev/null)"
system_ruby="$(rvm system ; which ruby 2>/dev/null)"
if [[ ! -x "$ruby" ]] ; then
if [[ ! -x "$system" ]] ; then
Expand Down

0 comments on commit 899df15

Please sign in to comment.