Closed whydna closed 5 months ago
When running a script with root privileges on macOS, you can determine the original user by checking the $SUDO_USER environment variable. This variable holds the username of the user who invoked the script with sudo.
Refer: https://www.sudo.ws/docs/man/1.8.10/sudo.man/#x454e5649524f4e4d454e54
Great library, thank you for making this.
Question - In the post install script, I want to know the user who initiated the installer. Because the post install script is initiated by root,
whoami
returns root.