Skip to content

Commit

Permalink
Pass path to dir_ls in build_readme
Browse files Browse the repository at this point in the history
Otherwise we assume the readme is always in the current working
directory.

Fixes #2344
  • Loading branch information
jimhester committed Apr 19, 2021
1 parent 96a54f5 commit d4510b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# devtools (development version)

* `build_readme()` now uses the `path` argument, as designed (#2344)

* The RStudio addins now use `test_active_file()` and `test_coverage_active_file()` instead of the deprecated `test_file()` and `test_coverage_file()` (#2339)

# devtools 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion R/build-readme.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ build_rmd <- function(files, path = ".", output_options = list(), ..., quiet = T
build_readme <- function(path = ".", quiet = TRUE, ...) {
pkg <- as.package(path)

readme_path <- path_abs(dir_ls(ignore.case = TRUE, regexp = "(inst/)?readme[.]rmd", recurse = 1, type = "file"))
readme_path <- path_abs(dir_ls(pkg$path, ignore.case = TRUE, regexp = "(inst/)?readme[.]rmd", recurse = 1, type = "file"))

if (length(readme_path) == 0) {
rlang::abort("Can't find a 'README.Rmd' or 'inst/README.Rmd' file.")
Expand Down

0 comments on commit d4510b2

Please sign in to comment.