From 31f4d8669ab87dbc89227b2cd01b6f34771caa60 Mon Sep 17 00:00:00 2001 From: tdro Date: Wed, 23 Dec 2020 01:16:28 -0500 Subject: .local/bin/scripts/file-search: Format --- .local/bin/scripts/file-search | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to '.local') diff --git a/.local/bin/scripts/file-search b/.local/bin/scripts/file-search index efd0824..130b90c 100755 --- a/.local/bin/scripts/file-search +++ b/.local/bin/scripts/file-search @@ -5,23 +5,23 @@ append() { find "$1" -maxdepth 1 -printf "%p\n" 2> /dev/null || true; } appendRecursive() { find "$1" -printf "%p\n" 2>/dev/null || true; } removeDuplicates() { awk '!visited[$0]++' "$1" | sponge "$1"; } -{ [ ! -f "$cache" ] \ - || [ "${1:-}" = "update" ]; } \ - && { - append "$HOME"; - append "$HOME"/.local; - append "$HOME"/Desktop; - append "$HOME"/Shares/Projects; - appendRecursive "$HOME"/.vim; - appendRecursive "$HOME"/.local/bin; - appendRecursive "$HOME"/.config; - appendRecursive "$HOME"/Music; - appendRecursive "$HOME"/Books; - appendRecursive "$HOME"/Videos; - appendRecursive "$HOME"/Documents; - appendRecursive "$HOME"/Downloads; - appendRecursive "$HOME"/Pictures; - } | grep -vE '(undodir)' > "$cache" +{ [ ! -f "$cache" ] || [ "${1:-}" = "update" ]; } && \ + { + append "$HOME"; + append "$HOME"/.local; + append "$HOME"/Desktop; + append "$HOME"/Shares/Projects; + appendRecursive "$HOME"/.vim; + appendRecursive "$HOME"/.local/bin; + appendRecursive "$HOME"/.config; + appendRecursive "$HOME"/Music; + appendRecursive "$HOME"/Books; + appendRecursive "$HOME"/Videos; + appendRecursive "$HOME"/Documents; + appendRecursive "$HOME"/Downloads; + appendRecursive "$HOME"/Pictures; + } \ + | grep -vE '(undodir)' > "$cache" [ "${1:-}" = "update" ] && removeDuplicates "$cache" && exit; -- cgit v1.2.3