fix: gpg background process

This commit is contained in:
mrjk 2023-04-17 14:41:41 -04:00
parent d5805041f5
commit 7744b3bda9

View File

@ -88,6 +88,8 @@ idm_gpg__enable ()
unset GPG_AGENT_INFO unset GPG_AGENT_INFO
fi fi
if [[ "${IDM_NO_BG:-false}" == true ]] || [[ -n "${DIRENV_IN_ENVRC-}" ]] ; then
# Check if socket is present # Check if socket is present
if [ ! -S "${GPG_AGENT_INFO-}" ]; then if [ ! -S "${GPG_AGENT_INFO-}" ]; then
rm -f "${XDG_RUNTIME_DIR}/pgp-agent/${id}/env" rm -f "${XDG_RUNTIME_DIR}/pgp-agent/${id}/env"
@ -98,6 +100,9 @@ idm_gpg__enable ()
if [ -f "${XDG_RUNTIME_DIR}/pgp-agent/${id}/env" ]; then if [ -f "${XDG_RUNTIME_DIR}/pgp-agent/${id}/env" ]; then
cat "${XDG_RUNTIME_DIR}/pgp-agent/${id}/env" cat "${XDG_RUNTIME_DIR}/pgp-agent/${id}/env"
fi fi
else
lib_log WARN "Start of gpg-agent background process disabled because of: IDM_NO_BG=${IDM_NO_BG:-false}"
fi
# Export tty to the current shell # Export tty to the current shell
echo "export GPG_TTY=$(tty)" echo "export GPG_TTY=$(tty)"