self-conscious-design
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

zip.sh
text/x-sh

Download raw (461 bytes)

#!/bin/bash

# no arguments: show available ebooks
if [ $# -eq 0 ]; then
    ls public/epub_content/ | grep -v epub_library.json
else
    if [ -d "public/epub_content/$1" ]; then
        echo "generating epub for $1"
        cd public/epub_content/$1
        rm -f $1.epub
        zip -X -Z store $1.epub mimetype
        zip -r $1.epub META-INF/ EPUB/ OEBPS/ -x "*.*~" "*.*.kate-swp"
    else
        echo "Folder doesn’t exist"
        exit 64
    fi
fi