-
-
Save leonid-shevtsov/1f6e8346ff474ac829380a32ff1548c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILES=$(find content static -iname '*.jpg' -size '+1000000c' | comm -23 - .jpegoptimignore) | |
if [[ $1 = 'do' ]]; then | |
jpegoptim --strip-com --strip-exif --strip-iptc --size=920 $FILES | |
else | |
# lint | |
if [[ -n "$FILES" ]]; then | |
echo "Some JPEG files are over 1000000:" | |
echo -e "$FILES"; | |
exit 1; | |
else | |
exit 0; | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment