Skip to content

Commit

Permalink
Bugfix: 'rvm list' now shows proper architecture strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Dec 14, 2009
1 parent 899df15 commit a3034be
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/utility
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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."
Expand Down

0 comments on commit a3034be

Please sign in to comment.