mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 05:18:17 +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() {
|
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
|
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 "$@"
|
command sudo -H --preserve-env=PATH env "$@"
|
||||||
else
|
else
|
||||||
command sudo -H "$@"
|
command sudo -H "$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue