From b54e1afdf322e57fc9e104a4edd05ba422156a08 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 21 Sep 2021 23:10:39 +0200 Subject: [PATCH] bin/edconf: exclude non-config files --- .local/bin/scripts/edconf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.local/bin/scripts/edconf b/.local/bin/scripts/edconf index 90fc930..2f15a29 100755 --- a/.local/bin/scripts/edconf +++ b/.local/bin/scripts/edconf @@ -5,7 +5,10 @@ alias dedup='awk '"'"'!a[$0]++'"'" listconf() { { cat "$conf_cache"; $(which fd || echo fdfind) --hidden --type file --size -1m --max-depth 1 . ~; - find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc /var/lib/postgres /var/lib/pleroma -maxdepth 4 -follow -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup + find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc /var/lib/postgres /var/lib/pleroma/static/instance \ + -maxdepth 4 -follow \( -name Partitions -o -name mdn -o -name .git -o -name .local \) -prune -o \ + ! -iname "*.xml" -a ! -iname "*.markdown" -a ! -iname "*.md" -a ! -iname "*.org" \ + -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup } conf_cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/edconf"