tests.sh 487 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. set -e
  3. # Ensure Artist metadata is not corrupt, does exist and at least 3 chars
  4. test_artist () {
  5. print_error () {
  6. echo "Failure! $1 missing Artist metadata! See README.md."
  7. exit 1
  8. }
  9. ARTIST="$(exif --tag=Artist --no-fixup -m "$1")" || print_error "$1"
  10. if [ "$(echo "$ARTIST" | wc -m)" -lt 3 ]; then
  11. print_error "$1"
  12. fi
  13. }
  14. for WALLPAPER in *.jpg
  15. do
  16. test_artist "$WALLPAPER"
  17. done
  18. echo "Success! Wallpapers have Artist metadata."