Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfix: silence another which ruby call and also test for executable …

…on system ruby.
  • Loading branch information...
commit 899df151bebe10d2b96e1ebc21b79e3fe089a0a4 1 parent c400533
@wayneeseguin wayneeseguin authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 scripts/utility
View
6 scripts/utility
@@ -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
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.