rbenv-sudo
rbenv-sudo copied to clipboard
Request: Enable passing of -E (--preserve-env) flag to sudo
From the man page:
-E, --preserve-env Indicates to the security policy that the user wishes to pre‐ serve their existing environment variables. The security policy may return an error if the user does not have permis‐ sion to preserve the environment.
I find this useful like so:
$ VAR1=foo rbenv sudo ./my-script
For the time-being, I can edit the script and add the -E flag, but it's not something I always want (or should always have turned on).
Alternately, you can do the following:
VAR1=foo
rbenv sudo VAR1=$VAR1 ./my-script