close #6 don't duplicate work extracting texts

This commit is contained in:
2026-08-13 00:45:00 -06:00
parent ed77743000
commit b5fcb8674f
+5 -1
View File
@@ -14,5 +14,9 @@ utility.ls("raw_ebooks", function(file_name)
if extension then
name = name:sub(1, -(#extension + 2))
end
os.execute(calibre_location .. "/Contents/MacOS/ebook-convert " .. ("raw_ebooks/" .. file_name):enquote() .. " " .. ("extracted_texts/" .. name .. ".txt"):enquote())
local output_name = "extracted_texts/" .. name .. ".txt"
if utility.path_exists(output_name) then return end
os.execute(calibre_location .. "/Contents/MacOS/ebook-convert " .. ("raw_ebooks/" .. file_name):enquote() .. " " .. output_name:enquote())
end)