bin/edconf: exclude non-config files

This commit is contained in:
xeruf 2021-09-21 23:10:39 +02:00
parent 5834f62a55
commit b54e1afdf3
1 changed files with 4 additions and 1 deletions

View File

@ -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"