File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 77# Usage is simple:
88#
99# gem install eeepub
10- # ruby ./epub.rb
10+ # ./script/publish
1111
1212require 'eeepub'
1313require 'date'
1414require 'fileutils'
1515
1616today = Date . today
17- system ( "../ jekyll build" )
17+ system ( "jekyll build" )
1818
1919GUIDE_DIR = File . expand_path ( "../.." , __FILE__ )
2020ORIGINAL_DIR = "#{ GUIDE_DIR } /_site"
2121TEMP_DIR = "epub_tmp"
22+ EBOOK_DIR = File . join GUIDE_DIR , "ebooks"
2223
2324FileUtils . mkdir_p ( "#{ TEMP_DIR } /images" )
2425FileUtils . cp ( Dir [ "#{ ORIGINAL_DIR } /images/*" ] , "#{ TEMP_DIR } /images" )
@@ -101,6 +102,8 @@ epub = EeePub.make do
101102 nav navigation
102103end
103104
105+
106+ FileUtils . mkdir_p EBOOK_DIR
104107sha = `git rev-parse HEAD` [ 0 ..5 ]
105- epub . save ( "#{ GUIDE_DIR } /ebooks /rgh-#{ today } _#{ sha } .epub" )
108+ epub . save ( "#{ EBOOK_DIR } /rgh-#{ today } _#{ sha } .epub" )
106109FileUtils . rm_rf ( "#{ TEMP_DIR } " )
You can’t perform that action at this time.
0 commit comments