Skip to content
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

Bypassing dependency overwrite #113

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

Haunfelder
Copy link

This pull request adds the ability to skip overwriting html dependencies if they already exist in the function copyDependenciesToDir. Intended to be used with rmarkdown::render to speed up rendering by decreasing I/O time.

Ryan Haunfelder added 3 commits September 18, 2018 22:37
…n which allows the user to specify whether or not html dependencies should be overwritten. When used to, for example, render rmarkdown html documents this can speed up I/O time considerably. If the dependency does not exist in the target directory and overwrite_dir is FALSE, the parameter is ignored and the directory is overwritten as usual.
Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, other than a few cosmetic issues like too wide lines in NEWS.md and roxygen, & should be &&, and missing spaces after if.

You also need to roxygenize to fix the current errors on Travis.

Thanks!

For the record, the background of this PR is https://stackoverflow.com/q/52337372/559676

@@ -290,6 +291,12 @@ copyDependencyToDir <- function(dependency, outputDir, mustWork = TRUE) {
} else dependency$name
target_dir <- file.path(outputDir, target_dir)

# if overwrite is false check to see if the file already exists
if(!overwrite_dir & dir_exists(target_dir)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition dir_exists(target_dir) may be a little weak. A stronger version is to check if all filenames in the target dir and the dependency object are identical. This makes sure when the dependency is updated (in future versions of the package where the dependency is introduced), you'll get the new version.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Ryan Haunfelder seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants