From: sev Date: Sun, 20 Mar 2022 05:43:55 +0000 (-0500) Subject: fix gpg forward GNUPGHOME reset in cleanup X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/4581a6bffd3bb69026230512836cefaed91fc1c9?ds=inline fix gpg forward GNUPGHOME reset in cleanup --- diff --git a/base/.zprofile b/base/.zprofile index 0d8a1a7..f611b98 100644 --- a/base/.zprofile +++ b/base/.zprofile @@ -44,13 +44,8 @@ function _sev_zcleanup { } } # reset GNUPGHOME if we removed our own dir - if [[ $GNUPGHOME =~ '/.ssh_forward/\d+/*$' && ! -e $GNUPGHOME ]] { - x=$GNUPGHOME - [[ -o GLOB_ASSIGN ]]; y=$? - setopt GLOB_ASSIGN - GNUPGHOME=$GNUPGHOME/../..(:a) - (( y != 0 )) && unsetopt GLOB_ASSIGN - } + if [[ $GNUPGHOME =~ '/.ssh_forward/\d+/*$' && ! -e $GNUPGHOME ]] + GNUPGHOME=${GNUPGHOME%$MATCH} } ## tmp