aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-12-05 04:45:38 -0500
committertdro <tdro@users.noreply.github.com>2020-12-05 04:45:38 -0500
commit927fbaf9a7b00d3fa507a91e2277153c1939c502 (patch)
treedc1a72c94fe2b85b43bacd892f65ac784fac3f73 /.local
parent2038dc9f3e44b6bbbebda7503dc1a6eeee1d7b97 (diff)
downloaddotfiles-927fbaf9a7b00d3fa507a91e2277153c1939c502.tar.gz
dotfiles-927fbaf9a7b00d3fa507a91e2277153c1939c502.tar.bz2
dotfiles-927fbaf9a7b00d3fa507a91e2277153c1939c502.zip
.local/bin/scripts/file-search: Drop mlocate
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/scripts/file-search34
1 files changed, 17 insertions, 17 deletions
diff --git a/.local/bin/scripts/file-search b/.local/bin/scripts/file-search
index bb744e5..2da2bf5 100755
--- a/.local/bin/scripts/file-search
+++ b/.local/bin/scripts/file-search
@@ -1,27 +1,27 @@
#!/bin/sh -eu
cache=/tmp/file_search_results.cache
-append() { find "$1" -maxdepth 1 -printf "%p\n"; }
-appendRecursive() { find "$1" -printf "%p\n"; }
+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" ]; } \
- && locate -ie \
- "$HOME"/.vim \
- "$HOME"/Music \
- "$HOME"/Books \
- "$HOME"/Videos \
- "$HOME"/Documents \
- "$HOME"/Downloads \
- "$HOME"/Pictures \
- "$HOME"/.local/bin \
- "$HOME"/.config/awesome \
- "$HOME"/.config/systemd \
- "$HOME"/.local/share/Trash \
- "$HOME"/.local/share/applications \
- > "$cache" \
- && { append "$HOME"; } >> "$cache"
+ && {
+ 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;
+ } > "$cache"
[ "${1:-}" = "update" ] && removeDuplicates "$cache" && exit;