check that gpg -n --list-keys reported no error

pull/170/head
joshr 7 years ago
parent 8233f3a1de
commit 1d32cd0650

@ -538,7 +538,7 @@ function _user_required {
local trustdb
trustdb=$(_get_secrets_dir_keys_trustdb)
local error_message="no users found. run 'git secret tell'."
local error_message="no permitted users found. run 'git secret tell email@address'."
if [[ ! -f "$trustdb" ]]; then
_abort "$error_message"
fi
@ -548,6 +548,10 @@ function _user_required {
local keys_exist
keys_exist=$($gpg_local -n --list-keys)
local exit_code=$?
if [[ exit_code -ne 0 ]]; then
_abort "unable to list public keys in gpg: exit code $exit_code"
fi
if [[ -z "$keys_exist" ]]; then
_abort "$error_message"
fi

@ -43,7 +43,7 @@ function reveal {
_decrypt "$path" "1" "$force" "$homedir" "$passphrase"
if [[ ! -f "$path" ]]; then
_abort "cannot find decrypted version of file: $filename"
_abort "cannot find decrypted version of file: $filename"
fi
counter=$((counter+1))

Loading…
Cancel
Save