adjust gemset explorer to work with new rvm version (fixes #108)

See https://github.com/wayneeseguin/rvm/issues/1285

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-11-02 21:46:08 +01:00
parent df88d98ea0
commit 0eac132b83

View file

@ -22,14 +22,14 @@ gemset="$__object_id"
ruby="$(echo "$gemset" | cut -d '@' -f 1)"
gemsetname="$(echo "$gemset" | cut -d '@' -f2)"
user="$(cat "$__object/parameter/user")"
if su - "$user" -c "[ ! -d ~/.rvm ]" ; then
if [ ! -e "~$user/.rvm/scripts/rvm" ] ; then
echo "absent"
exit 0
fi
if su - "$user" -c "source ~/.rvm/scripts/rvm
rvm list | grep -q $ruby"; then
if su - "$user" -c "source ~/.rvm/scripts/rvm
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname"; then
if su - "$user" -c 'source ~/.rvm/scripts/rvm; rvm list strings | grep -q "^$ruby\$"'; then
if su - "$user" -c 'source ~/.rvm/scripts/rvm; rvm use "$ruby" > /dev/null; rvm gemset list strings | cut -f 1 -d " " | grep -q "^$gemsetname\$"'; then
echo "present"
exit 0
fi