escape user parameter in __rvm* types
This commit is contained in:
parent
72dea3d930
commit
65be80f2c6
8 changed files with 21 additions and 21 deletions
|
@ -23,13 +23,13 @@ gemset="$(cat "$__object/parameter/gemset")"
|
||||||
ruby="$(echo "$gemset" | cut -d '@' -f 1)"
|
ruby="$(echo "$gemset" | cut -d '@' -f 1)"
|
||||||
gemsetname="$(echo "$gemset" | cut -d '@' -f2)"
|
gemsetname="$(echo "$gemset" | cut -d '@' -f2)"
|
||||||
user="$(cat "$__object/parameter/user")"
|
user="$(cat "$__object/parameter/user")"
|
||||||
if su - $user -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
|
if su - "$user" -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
|
||||||
echo "removed"
|
echo "removed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
|
if su - "$user" -c "source \"\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm list | grep -q $ruby"; then
|
rvm list | grep -q $ruby"; then
|
||||||
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
|
if su - "$user" -c "source \"\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname &&
|
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname &&
|
||||||
rvm use $gemset > /dev/null && gem list | grep -q $gem"; then
|
rvm use $gemset > /dev/null && gem list | grep -q $gem"; then
|
||||||
echo "installed"
|
echo "installed"
|
||||||
|
|
|
@ -29,13 +29,13 @@ if [ "$state_is" != "$state_should" ]; then
|
||||||
case "$state_should" in
|
case "$state_should" in
|
||||||
installed)
|
installed)
|
||||||
cat << DONE
|
cat << DONE
|
||||||
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use $gemset; gem install $gem"
|
rvm use $gemset; gem install $gem"
|
||||||
DONE
|
DONE
|
||||||
;;
|
;;
|
||||||
removed)
|
removed)
|
||||||
cat << DONE
|
cat << DONE
|
||||||
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use $gemset; gem uninstall $gem"
|
rvm use $gemset; gem uninstall $gem"
|
||||||
DONE
|
DONE
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -31,8 +31,8 @@ else
|
||||||
echo $default > "$__object/parameter/default"
|
echo $default > "$__object/parameter/default"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
__rvm $user --state installed
|
__rvm "$user" --state installed
|
||||||
require="__rvm/$user" \
|
require="__rvm/$user" \
|
||||||
__rvm_ruby $ruby --user $user --state installed --default $default
|
__rvm_ruby $ruby --user "$user" --state installed --default $default
|
||||||
require="__rvm_ruby/$ruby" \
|
require="__rvm_ruby/$ruby" \
|
||||||
__rvm_gemset $gemset --user $user --state installed --default $default
|
__rvm_gemset $gemset --user "$user" --state installed --default $default
|
||||||
|
|
|
@ -22,13 +22,13 @@ gemset="$__object_id"
|
||||||
ruby="$(echo "$gemset" | cut -d '@' -f 1)"
|
ruby="$(echo "$gemset" | cut -d '@' -f 1)"
|
||||||
gemsetname="$(echo "$gemset" | cut -d '@' -f2)"
|
gemsetname="$(echo "$gemset" | cut -d '@' -f2)"
|
||||||
user="$(cat "$__object/parameter/user")"
|
user="$(cat "$__object/parameter/user")"
|
||||||
if su - $user -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
|
if su - "$user" -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
|
||||||
echo "removed"
|
echo "removed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
|
if su - "$user" -c "source \"\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm list | grep -q $ruby"; then
|
rvm list | grep -q $ruby"; then
|
||||||
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
|
if su - "$user" -c "source \"\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname"; then
|
rvm use $ruby > /dev/null; rvm gemset list | grep -q $gemsetname"; then
|
||||||
echo "installed"
|
echo "installed"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -28,7 +28,7 @@ if [ "$state_is" != "$state_should" ]; then
|
||||||
case "$state_should" in
|
case "$state_should" in
|
||||||
installed)
|
installed)
|
||||||
cat << DONE
|
cat << DONE
|
||||||
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm $gemset --create"
|
rvm $gemset --create"
|
||||||
DONE
|
DONE
|
||||||
case "$default" in
|
case "$default" in
|
||||||
|
@ -36,7 +36,7 @@ DONE
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cat << DONE
|
cat << DONE
|
||||||
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use --default $gemset"
|
rvm use --default $gemset"
|
||||||
DONE
|
DONE
|
||||||
;;
|
;;
|
||||||
|
@ -44,7 +44,7 @@ DONE
|
||||||
;;
|
;;
|
||||||
removed)
|
removed)
|
||||||
cat << DONE
|
cat << DONE
|
||||||
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm use $ruby; rvm --force gemset delete $gemsetname"
|
rvm use $ruby; rvm --force gemset delete $gemsetname"
|
||||||
DONE
|
DONE
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -29,7 +29,7 @@ else
|
||||||
default="no"
|
default="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
__rvm $user --state installed
|
__rvm "$user" --state installed
|
||||||
require="__rvm/$user" \
|
require="__rvm/$user" \
|
||||||
__rvm_ruby $ruby --user $user --state installed --default $default
|
__rvm_ruby $ruby --user "$user" --state installed --default $default
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
|
|
||||||
ruby="$__object_id"
|
ruby="$__object_id"
|
||||||
user="$(cat "$__object/parameter/user")"
|
user="$(cat "$__object/parameter/user")"
|
||||||
if su - $user -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
|
if su - "$user" -c "[ ! -d \"\$HOME/.rvm\" ]" ; then
|
||||||
echo "removed"
|
echo "removed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if su - $user -c "source \"\$HOME/.rvm/scripts/rvm\"
|
if su - "$user" -c "source \"\$HOME/.rvm/scripts/rvm\"
|
||||||
rvm list | grep -q $ruby"; then
|
rvm list | grep -q $ruby"; then
|
||||||
echo "installed"
|
echo "installed"
|
||||||
else
|
else
|
||||||
|
|
|
@ -26,19 +26,19 @@ state_should="$(cat "$__object/parameter/state")"
|
||||||
if [ "$state_is" != "$state_should" ]; then
|
if [ "$state_is" != "$state_should" ]; then
|
||||||
case "$state_should" in
|
case "$state_should" in
|
||||||
installed)
|
installed)
|
||||||
echo "su - $user -c \"source \\\$HOME/.rvm/scripts/rvm;"\
|
echo "su - \"$user\" -c \"source \\\$HOME/.rvm/scripts/rvm;"\
|
||||||
"rvm install $ruby\""
|
"rvm install $ruby\""
|
||||||
case "$default" in
|
case "$default" in
|
||||||
no)
|
no)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "su - $user -c \"source \\\$HOME/.rvm/scripts/rvm;"\
|
echo "su - \"$user\" -c \"source \\\$HOME/.rvm/scripts/rvm;"\
|
||||||
"rvm use --default $ruby\""
|
"rvm use --default $ruby\""
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
removed)
|
removed)
|
||||||
echo "su - $user -c \"source \\\$HOME/.rvm/scripts/rvm;"\
|
echo "su - \"$user\" -c \"source \\\$HOME/.rvm/scripts/rvm;"\
|
||||||
"rvm remove $ruby\""
|
"rvm remove $ruby\""
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue