support root and user rvm

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
remotes/origin/2.0
Nico Schottelius 12 years ago
parent 07902f2a0b
commit 62c69c63b5
  1. 14
      conf/type/__rvm/explorer/state

@ -19,8 +19,18 @@
#
user="$__object_id"
if su - $user -c "[ -d \"\$HOME/.rvm\" ]" ; then
echo "present"
# RVM behaves differently if root is the username / uid == 0
if [ "$user" = "root" ]; then
if [ -d /usr/local/rvm ]; then
echo present
else
echo absent
fi
else
if su - $user -c "[ -d \"\$HOME/.rvm\" ]" ; then
echo "present"
else
echo "absent"
fi
fi

Loading…
Cancel
Save