diff options
author | tdro <tdro@users.noreply.github.com> | 2020-12-23 01:16:28 -0500 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2020-12-23 01:28:01 -0500 |
commit | 31f4d8669ab87dbc89227b2cd01b6f34771caa60 (patch) | |
tree | 0bb55fbfc0b380ee90305a4c3f2a2469245b00df /.local | |
parent | dd3764acf8be5e1c92a52bb6c381ef3bae6c9b07 (diff) | |
download | dotfiles-31f4d8669ab87dbc89227b2cd01b6f34771caa60.tar.gz dotfiles-31f4d8669ab87dbc89227b2cd01b6f34771caa60.tar.bz2 dotfiles-31f4d8669ab87dbc89227b2cd01b6f34771caa60.zip |
.local/bin/scripts/file-search: Format
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/scripts/file-search | 34 |
1 files changed, 17 insertions, 17 deletions
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; |