Last active
September 30, 2020 06:52
-
-
Save ronaldsuwandi/867fcc957f06c266aa4d126d9877c001 to your computer and use it in GitHub Desktop.
Create .cbz file from directory
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 | |
if [ -z "${prefix}" ]; then | |
echo "warn: prefix is not set" | |
fi | |
for f in *; do | |
if [ -d "${f}" ]; then | |
echo "Zipping ${f} to ${prefix}${f}.cbz" | |
zip -r "${prefix}${f}.cbz" "${f}" | |
fi | |
done | |
if [ "${delete}" ]; then | |
echo "deleting directories..." | |
for d in */; do | |
echo $d | |
rm -rf "$d" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment