Skip to content

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

@ThierryO

Description

@ThierryO

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)
      ]
    )
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions