getFiles: better handling of path pruning

This commit is contained in:
Vincent Riquer 2025-01-23 00:17:46 +01:00
parent cc9ccc6dc5
commit 16f0d42335

View File

@ -3,7 +3,7 @@ getFiles() {
scantime=$(date +%s)
for prune_expression in "${skippeddirectories[@]}"
do
prunes+="-path $sourcepath$prune_expression -prune -o "
prunes+=( -path "$sourcepath$prune_expression" -prune -o )
done
(( cron )) || echo -n "Scanning $sourcepath... "
# We probably have thousands of files, don't waste time on disk writes
@ -56,7 +56,7 @@ getFiles() {
fi
progressSpin
done < <(
find "$sourcepath" $prunes -type f -printf "%T@ %s %P\n"
find "$sourcepath" "${prunes[@]}" -type f -not -name '.*' -printf "%T@ %s %P\n"
)
echo 'COMMIT;' >&3
(( cron )) || echo -n $'\r'