Fix MacOS compatibility of the gpg-agent plugin

MacOS holds the GPG agent socket in a different directory than
Linux-based systems. Asking gpgconf for the correct path is the
most straightforward approach to fix this problem.
This commit is contained in:
Paweł Jan Czochański 2018-01-11 17:30:28 +01:00
parent c3b072eace
commit 504c32fa6e

View File

@ -1,5 +1,5 @@
# Enable gpg-agent if it is not running
GPG_AGENT_SOCKET="${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh"
GPG_AGENT_SOCKET="$(gpgconf --list-dirs agent-ssh-socket)"
if [ ! -S $GPG_AGENT_SOCKET ]; then
gpg-agent --daemon >/dev/null 2>&1
export GPG_TTY=$(tty)