diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-06-10 23:09:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 23:09:54 +0300 |
commit | 60970fcba50050a14f5d9443fab8b9ae224d9956 (patch) | |
tree | 56d641c5d5722f3d7c8ded956fcd151bd28247c0 | |
parent | a71a223511b29a41cfefea61e577e7255d46e207 (diff) |
ruby: revert sudo_if changes
-rw-r--r-- | src/ruby/install.sh | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/ruby/install.sh b/src/ruby/install.sh index 5152893..e68197a 100644 --- a/src/ruby/install.sh +++ b/src/ruby/install.sh @@ -167,15 +167,6 @@ check_packages() { fi } -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 @@ -279,8 +270,8 @@ if [ "${SKIP_RBENV_RBUILD}" != "true" ]; then if [ "${USERNAME}" != "root" ]; then mkdir -p /home/${USERNAME}/.rbenv/plugins - sudo_if chown -R ${USERNAME} /home/${USERNAME}/.rbenv - sudo_if chown -R ${USERNAME} /usr/local/rvm/ + sudo chown -R ${USERNAME} /home/${USERNAME}/.rbenv + sudo chown -R ${USERNAME} /usr/local/rvm/ if [[ ! -d "/home/${USERNAME}/.rbenv/plugins/ruby-build" ]]; then ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build |