aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-06-22 21:04:15 +0300
committerGitHub <noreply@github.com>2022-06-22 21:04:15 +0300
commit0f5c49bc3cd1268d4b945bb65df23cc5ac592083 (patch)
tree110d8dc1267cadc3b016957260a22136cb1dcb77
parent81d2c1564fc96b82173fcff955bebf9ea763a9a5 (diff)
remove sudo_if
-rw-r--r--src/ruby/install.sh14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/ruby/install.sh b/src/ruby/install.sh
index a1559b2..1c55fc6 100644
--- a/src/ruby/install.sh
+++ b/src/ruby/install.sh
@@ -168,16 +168,6 @@ check_packages() {
fi
}
-# Use sudo to run as non-root user is not already running
-sudo_if() {
- COMMAND="$*"
- if [ "$(id -u)" -eq 0 ] && [ "$USERNAME" != "root" ]; then
- su - "$USERNAME" -c "$COMMAND"
- else
- "$COMMAND"
- fi
-}
-
# Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive
@@ -251,7 +241,9 @@ if [ "${INSTALL_RUBY_TOOLS}" = "true" ]; then
# Non-root user may not have "gem" in path when script is run and no ruby version
# is installed by rvm, so handle this by using root's default gem in this case
ROOT_GEM="$(which gem || echo "")"
- sudo_if "${ROOT_GEM} install ${DEFAULT_GEMS}"
+ ${ROOT_GEM} install ${DEFAULT_GEMS}
+ echo "owners"
+ ls -la /usr/local/rvm/
fi
# VS Code server usually first in the path, so silence annoying rvm warning (that does not apply) and then source it