Created
September 19, 2011 13:51
-
-
Save robotmedia/1226536 to your computer and use it in GitHub Desktop.
Revisions
-
Robot Media revised this gist
Sep 21, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ fi initial=$PWD cd $input zip -0Xq $initial/$output mimetype zip -Xr9Dq $initial/$output * -x zepub.sh *.epub *.DS_Store echo $output # Validate if [ -f $validator_path ]; then -
Robot Media revised this gist
Sep 19, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,8 @@ # # EXAMPLES # # sh zepub book.epub # sh zepub book.epub /my/epub/folder # Path to EpubCheck (http://code.google.com/p/epubcheck) validator_path="/path/to/epubcheck/epubcheck-1.2.jar" -
Robot Media created this gist
Sep 19, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ # # zepub.sh 0.1 # Package & Validate ePub Files # by @robot_media (http://www.robotmedia.net) # thanks to @lizcastro (http://www.elizabethcastro.com/epub/) # # INSTRUCTIONS # # Make zepub.sh executable: chmod +x zepub.sh # Optional: to validate the resulting ePub files change the validator_path variable below. # # EXAMPLES # # ./zepub book.epub # ./zepub book.epub /my/epub/folder # Path to EpubCheck (http://code.google.com/p/epubcheck) validator_path="/path/to/epubcheck/epubcheck-1.2.jar" function usage () { cat <<EOF Usage: zepub output [input] EOF } # Output argument if [ -z "$1" ]; then usage exit 0 fi output=$1 # Remove existing output rm -f $output # Input argument if [ -n "$2" ]; then input=$2 else input="." fi # Package initial=$PWD cd $input zip -0Xq $initial/$output mimetype zip -Xr9Dq $initial/$output * -x zepub.sh *.epub echo $output # Validate if [ -f $validator_path ]; then cd $initial java -jar $validator_path $output fi