summaryrefslogtreecommitdiff
path: root/angou
diff options
context:
space:
mode:
authorShokara <shokara@snopyta.org>2021-06-12 13:06:12 -0400
committerShokara <shokara@snopyta.org>2021-06-12 13:06:12 -0400
commitef50e5e4053ee1804e6f5388e75e02c43da4f1ee (patch)
tree958c8f0d1d871a4f1207fc4b6b610c626de757ac /angou
parentfd8b9b1cd22c2828f9da5443b35582d384a65d01 (diff)
add .gpg to filename when view checks if it exists
Diffstat (limited to 'angou')
-rwxr-xr-xangou4
1 files changed, 2 insertions, 2 deletions
diff --git a/angou b/angou
index b7427ba..96a2c88 100755
--- a/angou
+++ b/angou
@@ -15,7 +15,7 @@ GPG_ID="$(cat .gpg-id)"
15 15
16# decrypt and print a password from ANGOU_DIR or print the directory structure 16# decrypt and print a password from ANGOU_DIR or print the directory structure
17view() { 17view() {
18 if [ -f "${1%%.gpg}" ]; then 18 if [ -f "${1%%.gpg}".gpg ]; then
19 gpg -qd "${1%%.gpg}".gpg 19 gpg -qd "${1%%.gpg}".gpg
20 elif [ -d "${1:-.}" ]; then 20 elif [ -d "${1:-.}" ]; then
21 tree "${1:-.}" 21 tree "${1:-.}"
@@ -27,7 +27,7 @@ view() {
27 27
28# copy the first line from view to clipboard 28# copy the first line from view to clipboard
29copy() { 29copy() {
30 [ ! -f "$1" ] && usage && exit 30 [ ! -f "${1%%.gpg}".gpg ] && usage && exit
31 31
32 view "$1" | sed 1q | $ANGOU_CLIPBOARD 32 view "$1" | sed 1q | $ANGOU_CLIPBOARD
33} 33}