[pass] [PATCH] tree listing: remove .gpg at the end, but keep bash colorzing

Lorenz Weber mail at lenzw.de
Sat Sep 20 22:22:49 CEST 2014


Hi,
the patch below keeps the current behaviour of removing .gpg at the end
of the line in the tree listing, but works with colorized lines now, too.


Before something like
"\e[1;34mblue-password.gpg\e[0m"
would have been output in blue, with the suffix .gpg

with this patch, it will be reduced to
"\e[1;34mblue-password\e[0m"
still rendering it blue, but without the .gpg file suffix.

This sould work things out on systems with weird file access settings
that lead to tree colorizing the output on files.

Greetings,
Lorenz






>From 452efb10432fc54147a44104f26f4636ad6133bd Mon Sep 17 00:00:00 2001
From: Lorenz Weber <mail at lenzw.de>
Date: Sat, 20 Sep 2014 22:14:15 +0200
Subject: [PATCH] tree listing: remove .gpg at the end, but keep bash
colorzing

---
 src/password-store.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 2287a46..851b371 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -332,7 +332,7 @@ cmd_show() {
                else
                        echo "${path%\/}"
                fi
-               tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed
's/\.gpg$//'
+                tree -C -l --noreport "$PREFIX/$path" | tail -n +2 |
sed 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}$/\1/' #remove .gpg at end of line,
but keep colors
        elif [[ -z $path ]]; then
                die "Error: password store is empty. Try \"pass init\"."
        else
--
2.1.0


More information about the Password-Store mailing list