Skip to content

Commit

Permalink
test if referenced files are contained in the build-dir directory, us…
Browse files Browse the repository at this point in the history
…e the current dir otherwise
  • Loading branch information
michal-h21 committed Apr 23, 2024
1 parent 612bc49 commit af9cfa3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

- 2024/04/23

- test if referenced files are contained in the `build-dir` directory, use the current dir otherwise.
https://github.com/michal-h21/tex4ebook/issues/126

- 2024/04/16

- fixed bug in `dvisvgm_hashes` log parsing. On Windows, it didn't expect `\r` characters at the line ends, they then ended in new SVG filenames.
Expand Down
10 changes: 7 additions & 3 deletions mkutils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ function parse_lg(filename, builddir)
table.insert(outputimages,rec)
end
)
line:gsub("File: (.*)", function(k)
k = dir .. k
line:gsub("File: (.*)", function(x)
local k = dir .. x
if not file_exists(k) then
k = x
end
if not usedfiles[k] then
table.insert(outputfiles,k)
usedfiles[k] = true
Expand Down Expand Up @@ -244,7 +247,8 @@ end

function file_in_builddir(filename, par)
if par.builddir and par.builddir ~= "" then
return par.builddir .. "/" .. filename
local newname = par.builddir .. "/" .. filename
return newname
end
return filename
end
Expand Down

0 comments on commit af9cfa3

Please sign in to comment.