mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
darwin-rebuild: add comments explaining the custom sudo
logic
This commit is contained in:
parent
0a686597fa
commit
9ee30f2534
1 changed files with 4 additions and 0 deletions
|
@ -18,7 +18,11 @@ showSyntax() {
|
|||
}
|
||||
|
||||
sudo() {
|
||||
# REMOVEME when support for macOS 10.13 is dropped
|
||||
# macOS 10.13 does not support sudo --preserve-env so we make this conditional
|
||||
if command sudo --help | grep -- --preserve-env= >/dev/null; then
|
||||
# We use `env` before our command to ensure the preserved PATH gets checked
|
||||
# when trying to resolve the command to execute
|
||||
command sudo -H --preserve-env=PATH env "$@"
|
||||
else
|
||||
command sudo -H "$@"
|
||||
|
|
Loading…
Reference in a new issue