projects/guix·blob javascript-team · refs

29 lines · 1.4 KiB

1Tree 2.0 and later will unconditionally ignore all options and write
2JSON data on file descriptor 3 when available, which causes problems
3for the test harness and other scripts that use FD 3. Work around by
4closing descriptor 3 for the 'tree' command.
5
6Taken from upstream:
7 https://git.zx2c4.com/password-store/commit/?id=eea24967a002a2a81ae9b97a1fe972b5287f3a09
8
9diff --git a/src/password-store.sh b/src/password-store.sh
10--- a/src/password-store.sh
11+++ b/src/password-store.sh
12@@ -402,7 +402,7 @@ cmd_show() {
13 else
14 echo "${path%\/}"
15 fi
16- tree -N -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
17+ tree -N -C -l --noreport "$PREFIX/$path" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' # remove .gpg at end of line, but keep colors
18 elif [[ -z $path ]]; then
19 die "Error: password store is empty. Try \"pass init\"."
20 else
21@@ -414,7 +414,7 @@ cmd_find() {
22 [[ $# -eq 0 ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
23 IFS="," eval 'echo "Search Terms: $*"'
24 local terms="*$(printf '%s*|*' "$@")"
25- tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
26+ tree -N -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" 3>&- | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
27 }
28
29 cmd_grep() {