Skip to content

Instantly share code, notes, and snippets.

@papettoTV
Last active August 29, 2015 13:56
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 papettoTV/8909115 to your computer and use it in GitHub Desktop.
Save papettoTV/8909115 to your computer and use it in GitHub Desktop.
epub3生成スクリプト
#!/bin/sh
# epub3生成スクリプト
# epub3ファイルを展開して修正後、再度epub3にパッケージングするためのスクリプト
#
# 対象のフォルダがある階層に移動して、スクリプト配置して実行
# epub作成するフォルダ名を引数に指定
#
# ex)
# ./make_epub.sh target_folder_name
# 結果、target_folder_name.epubが生成
if [ $# -ne 1 ]; then
echo "args not found."
exit
fi
fname=$1
if [ ! -e $fname ]; then
echo "$fname dir not found."
exit
fi
#main script
cd $fname
zip -0 -X ../$fname.epub mimetype
zip -9 -r ../$fname.epub META-INF OEBPS
#実行と同時にファイル開きたい場合
#open ../$fname.epub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment