diff options
| author | Shokara <shokara@snopyta.org> | 2021-06-12 13:06:12 -0400 |
|---|---|---|
| committer | Shokara <shokara@snopyta.org> | 2021-06-12 13:06:12 -0400 |
| commit | ef50e5e4053ee1804e6f5388e75e02c43da4f1ee (patch) | |
| tree | 958c8f0d1d871a4f1207fc4b6b610c626de757ac | |
| parent | fd8b9b1cd22c2828f9da5443b35582d384a65d01 (diff) | |
add .gpg to filename when view checks if it exists
| -rwxr-xr-x | angou | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -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 |
| 17 | view() { | 17 | view() { |
| 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 |
| 29 | copy() { | 29 | copy() { |
| 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 | } |
