Browse Source

add .gpg to filename when view checks if it exists

master
Shokara 6 months ago
parent
commit
ef50e5e405
Signed by: shokara GPG Key ID: 7F5702DEF8E6DC82
  1. 4
      angou

4
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
}

Loading…
Cancel
Save