ruby-install icon indicating copy to clipboard operation
ruby-install copied to clipboard

Give information when running sudo

Open bloerwald opened this issue 5 years ago • 1 comments

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.

bloerwald avatar Sep 09 '20 09:09 bloerwald

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 avatar Oct 10 '20 03:10 postmodern

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

postmodern avatar Jan 26 '23 02:01 postmodern