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

build_readme() does not find README in non interactive mode #2344

Closed
ThierryO opened this issue Apr 19, 2021 · 2 comments
Closed

build_readme() does not find README in non interactive mode #2344

ThierryO opened this issue Apr 19, 2021 · 2 comments

Comments

@ThierryO
Copy link

One of my functions check if the README.Rmd is build when it exists. I test my function via a unit test. When I run the unit test interactively if works as expected. When I run devtools::test() it fails with Can't find a 'README.Rmd' or 'inst/README.Rmd' file. (the related line in the devtools code).

I'm puzzled why this should happen as my code only runs build_readme() when the README.Rmd exists.

  if (file_test("-f", file.path(x$get_path, "README.Rmd"))) {
    status_before <- status(repo)
    build_readme(x$get_path, encoding = "UTF-8")
    doc_error <- c(
      doc_error,
      "`README.Rmd` need to be rendered. Run `devtools::build_readme()`"[
        !unchanged_repo(repo, status_before)
      ]
    )
  }
@jimhester
Copy link
Member

Thanks for opening the issue.

This looks like a bug that was introduced in a recent revision, the path argument was not being correctly passed to dir_ls(). It should be fixed now, if you could test your code with the current master branch and confirm it is fixed that would be great.

@ThierryO
Copy link
Author

I can confirm that the problem is solved. Thanks for the quick fix.

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

No branches or pull requests

2 participants