Skip to content

Instantly share code, notes, and snippets.

@pedrovgs
Last active December 4, 2020 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrovgs/46ea88001ac7e23232a407a55f04a16c to your computer and use it in GitHub Desktop.
Save pedrovgs/46ea88001ac7e23232a407a55f04a16c to your computer and use it in GitHub Desktop.
Manga Time!! Add these files to your path and from any folder execute mangaTime.sh or compressFiles.sh <FOLDER> to transform a folder with a set of images into a zip folder
#!/bin/bash
if [ -z "$1" ]; then
echo "Help : To compress file use argument with directory"
exit 0
fi
filename="${1}.cbz"
if [ -e "$filename" ]; then
echo "WARNING: file exists: $filename" >&2
else
echo "Compresing $@ into $filename"
cd "$@"
zip "$filename" *
mv "$filename" ..
cd ..
fi
#!/bin/bash
for file in *
do
if [[ -d "$file" ]]; then
compressFiles.sh "$file"
fi
done
mkdir zips
mv *.cbz zips/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment