Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give information when running sudo #374

Closed
bloerwald opened this issue Sep 9, 2020 · 2 comments
Closed

Give information when running sudo #374

bloerwald opened this issue Sep 9, 2020 · 2 comments

Comments

@bloerwald
Copy link

bloerwald commented Sep 9, 2020

I think it would also be a good idea to warn about what is suddenly sudo'd. I ran into an unexpected password prompt due to #338, which is surely not something I would have expected while not doing a --system install.

I'd suggest

function nice_sudo() 
{
  echo "Running 'sudo ${@}'!"
  sudo "${@}"
}
if (( UID == 0 )); then sudo=""
else                    sudo="nice_sudo"
fi

for sake of user experience and transparency.

@postmodern
Copy link
Owner

It might be useful to output as debugging messages enabled by a --debug option. ruby-install by default doesn't print the commands it's running, just descriptive messages, so a giant sudo command in the output might be surprising to users.

@postmodern
Copy link
Owner

The 0.9.0 branch now has a -D,--debug option that will output any sudo commands. fb4779c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants