commit ef50e5e4053ee1804e6f5388e75e02c43da4f1ee
parent fd8b9b1cd22c2828f9da5443b35582d384a65d01
Author: Shokara <shokara@snopyta.org>
Date: Sat, 12 Jun 2021 13:06:12 -0400
add .gpg to filename when view checks if it exists
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/angou b/angou
@@ -15,7 +15,7 @@ GPG_ID="$(cat .gpg-id)"
# decrypt and print a password from ANGOU_DIR or print the directory structure
view() {
- if [ -f "${1%%.gpg}" ]; then
+ if [ -f "${1%%.gpg}".gpg ]; then
gpg -qd "${1%%.gpg}".gpg
elif [ -d "${1:-.}" ]; then
tree "${1:-.}"
@@ -27,7 +27,7 @@ view() {
# copy the first line from view to clipboard
copy() {
- [ ! -f "$1" ] && usage && exit
+ [ ! -f "${1%%.gpg}".gpg ] && usage && exit
view "$1" | sed 1q | $ANGOU_CLIPBOARD
}