Skip to content

Commit

Permalink
Skip empty directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Dittmann committed Jun 4, 2011
1 parent b1f9e00 commit be836d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions check_and_update_checksums.sh
Expand Up @@ -11,6 +11,10 @@ escape_for_grep() {
printf '%s\n' "$a"
}

contains_files() {
[[ $(find "$1" -maxdepth 1 -type f -printf . -quit) ]]
}

check_checksum() { (
cd "$1" || exit
if [[ $nocheck ]]; then
Expand Down Expand Up @@ -71,6 +75,7 @@ error=
missing=
while IFS= read -d '' -r dir; do
echo -e "\n** Checking $dir"
contains_files "$dir" || { echo 'No files to check.'; continue; }
if [[ -s $dir/.md5 ]]; then
if ! check_checksum "$dir"; then
error=1
Expand Down

0 comments on commit be836d6

Please sign in to comment.