ruby-install
ruby-install copied to clipboard
Give information when running sudo
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.
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.
The 0.9.0 branch now has a -D,--debug option that will output any sudo commands. fb4779c