-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix creating record file when not required #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR!
lua/typst-preview/fetch.lua
Outdated
for _, bin in pairs(M.bins_to_fetch()) do | ||
record:write(bin.url .. '\n') | ||
if config.opts.dependencies_bin[bin.name] ~= nil then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this mark record_required as false when one of the dependencies_bin doesn't need to be downloaded but the other one does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah true, my bad
lua/typst-preview/fetch.lua
Outdated
if record == nil then | ||
error("Can't open record file!: " .. err) | ||
end | ||
for _, bin in pairs(M.bins_to_fetch()) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's best to only write the bin that are not in dependencies_bin into record file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that would be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it still creates version_record.txt
but it doesn't error since the parent directories will be created
Fixes: #72