Skip to content

Commit

Permalink
even better zip testing
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-h21 committed Apr 21, 2024
1 parent 65b2432 commit a883721
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tex4ebook-exec_epub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,15 @@ end
local function find_zip()
local zip_handle = assert(io.popen("zip -v 2>&1","r"))
local miktex_zip = assert(io.popen("miktex-zip -v 2>&1","r"))
if zip_handle:read("*all") ~= "" then
zip_handle:close()
miktex_zip:close()
local zip_result = zip_handle:read("*all")
local miktex_result = miktex_zip:read("*all")
zip_handle:close()
miktex_zip:close()
if zip_result and zip_result:match("Zip") then
return "zip"
elseif miktex_zip:read("*all") ~= "" then
zip_handle:close()
miktex_zip:close()
elseif miktex_result and miktex_result:match("Zip") then
return "miktex-zip"
end
zip_handle:close()
miktex_zip:close()
log:warning "It appears you don't have zip command installed. I can't pack the ebook"
return "zip"
end
Expand Down

0 comments on commit a883721

Please sign in to comment.