Skip to content

Commit d4510b2

Browse files
committed
Pass path to dir_ls in build_readme
Otherwise we assume the readme is always in the current working directory. Fixes #2344
1 parent 96a54f5 commit d4510b2

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# devtools (development version)
22

3+
* `build_readme()` now uses the `path` argument, as designed (#2344)
4+
35
* The RStudio addins now use `test_active_file()` and `test_coverage_active_file()` instead of the deprecated `test_file()` and `test_coverage_file()` (#2339)
46

57
# devtools 2.4.0

R/build-readme.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ build_rmd <- function(files, path = ".", output_options = list(), ..., quiet = T
5151
build_readme <- function(path = ".", quiet = TRUE, ...) {
5252
pkg <- as.package(path)
5353

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

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

0 commit comments

Comments
 (0)