zola
zola copied to clipboard
Refactor: remove even more unnecessary create_directory
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
- [x] Are you doing the PR on the
next
branch?
These are some things that were missed even by #2407.
After doing some more investigation, even copying files will automatically create directories, so, we don't need these calls either. It simplifies the code a bit more and will also ensure that directories aren't created unless files are actually inside them.
Another reason for this change is it also makes calls to write_content
and write_section
a bit less confusing, since right now, if multiple calls to it are made, the final argument is set to false
to avoid doing work, which can make following the code a bit more challenging since it's not always clear when this argument is applied.
Looks like legit CI failures?
They were, and sorry for taking so long to get back to this. Essentially, I thought that since these directories were always being made for copied files, they were also made for created files, which was not the case. I decided to go ahead and update things so that this is the case, but I understand if you'd rather not merge this PR because of that. While I personally think it makes the code simpler, that's not really an objective thing, just my opinion.