Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bugfix: 'rvm list' now shows proper architecture strings.

  • Loading branch information...
commit a3034bedbb52906be7690cdd740a6263da407bda 1 parent 899df15
@wayneeseguin wayneeseguin authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 scripts/utility
View
14 scripts/utility
@@ -289,7 +289,7 @@ __rvm_list() {
if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
string="$($version -v | awk '{print $NF}')"
else
- string="[$(file $rvm_path/$version/bin/ruby | awk -F: '{print $2}' | awk '{print $NF}')]"
+ string="[ $(file $rvm_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
fi
if [[ "$version" = "$current_ruby" ]] ; then
echo -e "=> $(tput setaf 2)$version$(tput sgr0) $string"
@@ -302,7 +302,7 @@ __rvm_list() {
if [[ -f "$rvm_path/default" ]] && [[ -s $rvm_path/default ]] ; then
version=$(grep '^MY_RUBY_HOME' $rvm_path/default | awk -F"'" '{print $2}' | xargs basename)
if [[ ! -z "$version" ]] ; then
- string=$(file $rvm_path/$version/bin/ruby)
+ string="[ $(file $rvm_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
if [[ "$version" = "$current_ruby" ]] ; then
echo -e "=> $(tput setaf 3)(default)$(tput sgr0) $(tput setaf 2)$version$(tput sgr0) $string"
selected="1"
@@ -314,11 +314,13 @@ __rvm_list() {
system_ruby="$(rvm system ; which ruby 2>/dev/null)"
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"
+ #system_version=$($system_ruby -v | awk -F: '{print $2}' | grep 8 | awk '{print $NF}' | tr "\n" ' ')
+ system_version=$($system_ruby -v)
+ string="[ $(file $system_ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
+ if [[ ! -z "$system_ruby" ]] && [[ "$system_ruby -v)" = "$system_version" ]] ; then
+ echo -e "=> $(tput setaf 2)system$(tput sgr0) $string\n"
else
- echo -e " $(tput setaf 2)system$(tput sgr0) [$system_version]\n"
+ echo -e " $(tput setaf 2)system$(tput sgr0) $string\n"
fi
else
$rvm_scripts_path/log "info" "No system ruby found."
Please sign in to comment.
Something went wrong with that request. Please try again.