Skip empty dir

This commit is contained in:
Antonio J. Delgado 2024-12-12 15:39:50 +02:00
parent c38ace8ab7
commit e84bc9896e

View file

@ -1,6 +1,7 @@
#!/bin/bash
while read -r dir
do
if [ -n "${dir}" ]; then
echo "Checking dir '${dir}'..."
last_file="${dir}/$(ls -ht -- "${dir}/" | grep \.webm\.download_info\.json | head -n1)"
if [ "${last_file}" == "${dir}/" ]; then
@ -20,4 +21,5 @@ do
touch -r "${last_file}" -- "${dir}"
fi
fi
fi
done <<< "$(find . -mindepth 1 -maxdepth 1 -type d)"