vns_print now verifies the existence of the note to print

This commit is contained in:
Vera Lewis
2024-03-31 02:17:00 -05:00
parent 2bcbf830d4
commit a7c57c3779

12
vns
View File

@@ -308,11 +308,17 @@ vns_print () {
# print the given note to stdout
# Verify $1 is bound
if [ "$#" -lt 1 ]; then vns_raise "Insufficient arguments" 11; fi
if [ "$#" -lt 1 ]; then
vns_raise "Insufficient arguments" 11
# Decrypt the specified note
gpg2 --batch -d "$VNS_STORE/$1.gpg"
# Verify $1 exists
elif ! [ -r "$VNS_STORE/$1.gpg" ]; then
vns_raise "Could not read $1" 12
else
# Decrypt the specified note
gpg2 --batch -d "$VNS_STORE/$1.gpg"
fi
}
vns_mv () {