Skip to content

Commit 4a67d29

Browse files
committed
Address #61 for adding gpg keys as well. Show any error output
as a warning.
1 parent ea134ac commit 4a67d29

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

keychain.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,12 @@ if wantagent gpg; then
10951095
set +f # re-enable globbing
10961096

10971097
for k in "$@"; do
1098-
echo | env LC_ALL="$pinentry_lc_all" "${gpg_prog_name}" --no-options --use-agent --no-tty --sign --local-user "$k" -o- >/dev/null 2>&1 || tryagain=true
1098+
gpgout="$(echo | env LC_ALL="$pinentry_lc_all" "${gpg_prog_name}" --no-options --use-agent --no-tty --sign --local-user "$k" -o- 2>&1)"
1099+
ret=$?
1100+
if [ "$ret" -ne 0 ]; then
1101+
tryagain=true
1102+
warn "Error adding gpg key (error code: $ret; output: $gpgout)"
1103+
fi
10991104
done
11001105
$tryagain || break
11011106

0 commit comments

Comments
 (0)