Skip to content

Commit

Permalink
Merge pull request #946 from kmuto/doublerm
Browse files Browse the repository at this point in the history
epubmakerで一時フォルダが残っているときに2回目のremove_entry_secureを実行するようにする
  • Loading branch information
kmuto authored Feb 20, 2018
2 parents 50ab246 + 060592e commit 3d0586b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/review/epubmaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def produce(yamlfile, bookname = nil)
@producer.produce("#{bookname}.epub", basetmpdir, epubtmpdir)
log('Finished.')
ensure
FileUtils.remove_entry_secure basetmpdir unless @config['debug']
FileUtils.remove_entry_secure(basetmpdir) unless @config['debug']
end
end

Expand Down Expand Up @@ -364,7 +364,8 @@ def detect_properties(path)
def write_info_body(basetmpdir, _id, filename, ispart = nil, chaptype = nil)
headlines = []
path = File.join(basetmpdir, filename)
Document.parse_stream(File.new(path), ReVIEWHeaderListener.new(headlines))
htmlio = File.new(path)
Document.parse_stream(htmlio, ReVIEWHeaderListener.new(headlines))
properties = detect_properties(path)
prop_str = ''
prop_str = ',properties=' + properties.join(' ') if properties.present?
Expand All @@ -378,6 +379,7 @@ def write_info_body(basetmpdir, _id, filename, ispart = nil, chaptype = nil)
first = nil
end
end
htmlio.close
end

def push_contents(_basetmpdir)
Expand Down

0 comments on commit 3d0586b

Please sign in to comment.