Skip to content

Commit 78f6d1f

Browse files
committed
refactor: adapt code to upstream changes
1 parent 2e63b27 commit 78f6d1f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

R/pkgpurl.gen.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ assemble_copyright_notice <- function(path) {
6565
if (desc::desc_has_fields(keys = "Authors@R",
6666
file = path)) {
6767

68-
pkg <- pal::desc_value(key = "Package",
69-
file = path)
70-
desc <- pal::desc_value(key = "Title",
71-
default = "",
72-
file = path)
68+
pkg <- pal::desc_get_field_safe(key = "Package",
69+
file = path)
70+
desc <- pal::desc_get_field_safe(key = "Title",
71+
default = "",
72+
file = path)
7373
authors <-
7474
desc::desc_get_authors(file = path) |>
7575
# reduce to copyright holders or otherwise authors
@@ -108,8 +108,8 @@ assemble_license_notice <- function(path) {
108108
if (desc::desc_has_fields(keys = "License",
109109
file = path)) {
110110

111-
license <- pal::desc_value(key = "License",
112-
file = path)
111+
license <- pal::desc_get_field_safe(key = "License",
112+
file = path)
113113

114114
if (grepl(x = license,
115115
pattern = "^\\s*(AGPL ?\\(>= ?3\\)|AGPL-3\\.0-or-later)\\s*$")) {
@@ -226,8 +226,8 @@ main_rmd <- function(path = ".") {
226226
rmd_file_paths |>
227227
fs::path_file() |>
228228
fs::path_ext_remove() |>
229-
magrittr::is_in(pal::desc_value(key = "Package",
230-
file = path)) |>
229+
magrittr::is_in(pal::desc_get_field_safe(key = "Package",
230+
file = path)) |>
231231
which() %>%
232232
magrittr::extract(rmd_file_paths, .) |>
233233
pal::when(length(.) > 1L ~ # this is theoretically possible in case of subdirs under `Rmd/` or for case-sensitive filesystems (both `.Rmd` and `.rmd`)

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ output: pal::gitlab_document
99
knitr::opts_knit$set(root.dir = getwd())
1010
```
1111

12-
# `r pal::desc_value("Package")`
12+
# `r pal::desc_get_field_safe("Package")`
1313

1414
```{r}
1515
#| label: pkg-desc

Rmd/pkgpurl.Rmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ assemble_copyright_notice <- function(path) {
8181
if (desc::desc_has_fields(keys = "Authors@R",
8282
file = path)) {
8383
84-
pkg <- pal::desc_value(key = "Package",
85-
file = path)
86-
desc <- pal::desc_value(key = "Title",
87-
default = "",
88-
file = path)
84+
pkg <- pal::desc_get_field_safe(key = "Package",
85+
file = path)
86+
desc <- pal::desc_get_field_safe(key = "Title",
87+
default = "",
88+
file = path)
8989
authors <-
9090
desc::desc_get_authors(file = path) |>
9191
# reduce to copyright holders or otherwise authors
@@ -130,8 +130,8 @@ assemble_license_notice <- function(path) {
130130
if (desc::desc_has_fields(keys = "License",
131131
file = path)) {
132132
133-
license <- pal::desc_value(key = "License",
134-
file = path)
133+
license <- pal::desc_get_field_safe(key = "License",
134+
file = path)
135135
136136
if (grepl(x = license,
137137
pattern = "^\\s*(AGPL ?\\(>= ?3\\)|AGPL-3\\.0-or-later)\\s*$")) {
@@ -272,8 +272,8 @@ main_rmd <- function(path = ".") {
272272
rmd_file_paths |>
273273
fs::path_file() |>
274274
fs::path_ext_remove() |>
275-
magrittr::is_in(pal::desc_value(key = "Package",
276-
file = path)) |>
275+
magrittr::is_in(pal::desc_get_field_safe(key = "Package",
276+
file = path)) |>
277277
which() %>%
278278
magrittr::extract(rmd_file_paths, .) |>
279279
pal::when(length(.) > 1L ~ # this is theoretically possible in case of subdirs under `Rmd/` or for case-sensitive filesystems (both `.Rmd` and `.rmd`)

0 commit comments

Comments
 (0)