
This commit solves an issue where the environment handed to `/usr/sbin/installer` is not the same as the environment used by the graphical PKG installer. This is evident in some post-install scripts, e. g. the `component-10.pkg/Scripts/postinstall` script in the `dymo-label` cask. The code says: ``` USER_ID=`id -u ${USER}` launchctl bootstrap gui/$USER_ID /Library/LaunchAgents/com.dymo.dls.webservice.plist ``` The graphical installer will export e. g. `USER=alice`, and everything works as intended. However, `brew cask install` does not override `sudo`’s default, which is `USER=ROOT`. This violates the assumptions in the script. This commit fixes the issue by configuring `sudo` to override the following environment variables with the proper user name: - `LOGNAME` - `USER` - `USERNAME`
Library
This directory contains all the code run by the official brew
and brew cask
commands in Homebrew
and all formulae (package descriptions) in taps (repositories containing formulae) in Taps
subdirectories.