-
Notifications
You must be signed in to change notification settings - Fork 70
Keep copyDependencyToDir() from creating empty directories
#276
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
Conversation
|
I suppose this PR should fix the mysterious empty directories created after knitting a Could someone merge this PR to implement @gadenbuie's proposal? Thank you! |
|
I don't know it this adds any additional information, but I have found that this problem occurs when I use
(regardless of whether I add |
Co-authored-by: Barret Schloerke <barret@rstudio.com>
|
@cpsievert I made the change requested by @schloerke, this should be good to go now! |
|
@gadenbuie thanks! Please also add a NEWS item and then I'll merge |
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
|
@schloerke any idea what's going wrong here? https://github.com/rstudio/htmltools/runs/4193559908?check_suite_focus=true#step:5:1270 |
|
@cpsievert I have no clue. 😞 It is extremely odd. It is tied to Why it is odd is that every other linux job works. I also busted the cache by incrementing the cache number, still no improvement. Also removed `extra-packages to be installed afterwards, still no improvement. |
NEWS.md
Outdated
|
|
||
| * Closed #225: Added `tagInsertChildren()` to be able to insert child tag objects at a particular location. (#224) | ||
|
|
||
| * `copyDependencyToDir()` no longer creates empty directories for dependencies that do not have any files. (@gadenbuie, #276) |
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.
@gadenbuie would you mind rebasing/merging with main so this gets put in the right place?
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.
When an
htmlDependency()doesn't have any files,copyDependencyToDir()will still create an empty directory, as in the reprex below. This PR fixes this behavior by cleaning up the target directory when the dependency doesn't have any source files.We still temporarily create the target directory and update the dependencies
$src$filevalue, though, because rmarkdown will eventually callmakeDependencyRelative()and we need$src$fileto be a child of the document'sbasediror an error is thrown.