More portable EUID check (#102)

This commit is contained in:
Ana Hobden 2022-12-09 08:17:26 -08:00 committed by GitHub
parent cfded4bb8a
commit f9532cb194
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,7 @@ main() {
fi
local maybe_sudo=""
if [ "$EUID" -ne 0 ] && command -v sudo > /dev/null; then
if [ "$(id -u)" -ne 0 ] && command -v sudo > /dev/null; then
maybe_sudo="sudo"
fi