diff options
Diffstat (limited to 'Master/texmf-dist/scripts/tex4ebook/tex4ebook-exec_azw3.lua')
-rwxr-xr-x | Master/texmf-dist/scripts/tex4ebook/tex4ebook-exec_azw3.lua | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Master/texmf-dist/scripts/tex4ebook/tex4ebook-exec_azw3.lua b/Master/texmf-dist/scripts/tex4ebook/tex4ebook-exec_azw3.lua index 33e8a1182c5..36c537f7eeb 100755 --- a/Master/texmf-dist/scripts/tex4ebook/tex4ebook-exec_azw3.lua +++ b/Master/texmf-dist/scripts/tex4ebook/tex4ebook-exec_azw3.lua @@ -1,5 +1,6 @@ module(...,package.seeall) local eb = require("tex4ebook-exec_epub") +local mobi = require("tex4ebook-exec_mobi") local ebookutils = require("mkutils") local log = logging.new "exec_azw" @@ -19,13 +20,18 @@ function writeContainer() -- find the azw filename local azwfile = eb.outputfile:gsub("epub$", "azw3") local azwdist = eb.destdir .. azwfile - local command = "kindlegen " .. epubpath .. " -o " .. azwfile - log:info("Pack azw ".. command) - local status, output = ebookutils.execute(command) - -- copy the azw file to the destination directory - -- the destination directory will be created by the epub writer, so it is possible to use - -- the cp function which doesn't try to create directory - ebookutils.cp(eb.basedir .. "/" .. azwfile, azwdist) + -- local command = "kindlegen " .. epubpath .. " -o " .. azwfile + -- log:info("Pack azw ".. command) + -- local status, output = ebookutils.execute(command) + local status = mobi.kindlegen(epubpath, azwfile) + if status then + -- copy the azw file to the destination directory + -- the destination directory will be created by the epub writer, so it is possible to use + -- the cp function which doesn't try to create directory + if azwfile ~= azwdist then + ebookutils.cp(azwfile, azwdist) + end + end return ret end |