gpg modules: use gpgconf for other variable

This commit is contained in:
Vonfry 2019-01-26 11:17:20 +08:00
parent a170d5b2b2
commit 2e1b45c048
No known key found for this signature in database
GPG Key ID: 7FC96CE000223B1C

View File

@ -11,9 +11,9 @@ if (( ! $+commands[gpg-agent] )); then
fi
# Set the default paths to gpg-agent files.
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
_gpg_agent_conf="$(gpgconf --list-dir homedir)/gpg-agent.conf"
_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID"
_gpg_agent_socket="$(gpgconf --list-dir | grep "agent-socket:.*" | sed "s/agent-socket://")"
_gpg_agent_socket="$(gpgconf --list-dir agent-socket)"
# Load environment variables from previous run
source "$_gpg_agent_env" 2> /dev/null