Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/osx/Installer.Mac/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ mkdir -p /usr/local/bin
/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager" /usr/local/bin/git-credential-manager

# Configure GCM for the current user (running as the current user to avoid root
# from taking ownership of ~/.gitconfig)
sudo -u ${USER} "$INSTALL_DESTINATION/git-credential-manager" configure
# from taking ownership of ~/.gitconfig).
# Use stat to determine the console user since the installer may be invoked with
# USER unset (e.g. when run via Homebrew which explicitly clears USER).
REAL_USER=$(stat -f%Su /dev/console)
sudo -u "${REAL_USER}" "$INSTALL_DESTINATION/git-credential-manager" configure

exit 0
Loading