Created
February 9, 2025 19:55
-
-
Save rnikitin/7059b4f56e1221dbfc3b29533fcf31f4 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
for f in *.epub; do if [ -d "$f" ]; then (cd "$f" && find . -name "iTunesMetadata*.plist" -delete 2>/dev/null && zip -0X "../tmp.epub" mimetype >/dev/null && zip -rDX9 "../tmp.epub" * -x "*.DS_Store" -x mimetype >/dev/null && echo "Converting: $f") && rm -rf "$f" && mv tmp.epub "$f"; elif [[ $(unzip -l "$f" 2>/dev/null | grep iTunesMetadata) == "" ]]; then echo "Already clean: $f"; else echo "Converting: $f"; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment