Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix rvm list for architecture wrt gemsets

  • Loading branch information...
commit 5f41bb31da96d97a612657e6dd8dbe17784c5467 1 parent b1012ef
Darcy Laycock Sutto authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 scripts/list
12 scripts/list
View
@@ -17,13 +17,15 @@ list_gemsets() {
printf "rvm gemsets\n"
for version in $(\ls $rvm_gems_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
- if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
- string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}') ]"
- elif [[ ! -z "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
+ ruby_version_name="$(echo "$version" | awk -F"$rvm_gemset_separator" '{print $1}')"
+ if [[ -n "$(echo $version | awk '/^jruby-/')" ]] ; then
+ string="[ $($rvm_rubies_path/$ruby_version_name/bin/ruby -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
+ elif [[ -n "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
string="[ x86_64 ]"
else
- string="[ $(file $rvm_rubies_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
+ string="[ $(file $rvm_rubies_path/$ruby_version_name/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
fi
+ unset ruby_version_name
printf "\n"
if [[ "$version" = "$current_ruby" ]]; then
printf "=> "
@@ -90,7 +92,7 @@ list_rubies() {
printf "rvm rubies\n"
for version in $(\ls $rvm_rubies_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
if [[ ! -z "$(echo $version | awk '/^jruby-/')" ]] ; then
- string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}') ]"
+ string="[ $($rvm_rubies_path/$version/bin/ruby -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
elif [[ ! -z "$(echo $version | awk '/^maglev-|^macruby-/')" ]] ; then
string="[ x86_64 ]"
else
Please sign in to comment.
Something went wrong with that request. Please try again.