Skip to content

Commit 2c72c90

Browse files
committed
fix(vendor): handle timestamp updating and case sensitivity
1 parent 6549b74 commit 2c72c90

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# rpkgkit 0.1.7 (2026-07-02)
22

3+
## BUG FIXES
4+
5+
* Fixed timestamp updating bug in `add_changelog_in_standalone()` when modifying `vendor-*.R`
6+
7+
38
## NEW FEATURES
49

510
* Added `use_r_v4.1.0()`

R/23_add_changelog_in_standalone.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ add_changelog_in_standalone <- function(
4646
} else if (is_pkg(path)) {
4747
files <- list.files(
4848
file.path(path, "R"),
49-
pattern = "^standalone-",
49+
pattern = "^standalone-|^vendor-",
5050
full.names = TRUE
5151
)
5252
} else if (dir.exists(path)) {
@@ -76,7 +76,11 @@ add_changelog_in_standalone <- function(
7676
}
7777
yaml_end <- yaml_end[2L]
7878

79-
lastupdated_idx <- grep("^#\\s+last-updated:\\s*", lines)
79+
lastupdated_idx <- grep(
80+
"^#\\s+last-updated:\\s*",
81+
lines,
82+
ignore.case = TRUE
83+
)
8084
if (length(lastupdated_idx) > 0L) {
8185
lines[lastupdated_idx] <- sprintf("# last-updated: %s", date)
8286
}
@@ -128,7 +132,7 @@ add_changelog_in_standalone <- function(
128132
)
129133

130134
cli::cli_alert_success(
131-
"Added changelog entry for {.val {date}} in {sum(updated)} file(s)."
135+
"Added changelog entry ({date}) for {.path {files}}."
132136
)
133137

134138
invisible(files[updated])

R/vendor-pkgdev.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
# Authors: Diego Hernangómez
55
# License: MIT + file LICENSE (See inst/vendor/pkgdev/LICENSE)
66
# Generated by: rpkgkit::use_vendor("dieghernan/pkgdev", "add_global_gitgnore.R")
7-
# Last-updated: 2026-06-30
7+
# last-updated: 2026-07-08
88
# Vendor version: 0.1.0.9150
99
# Imports: devtools, usethis
1010
# ==============================================================================
1111
#
12+
#
13+
# ## Changelog:
14+
#
15+
# 2026-07-08:
16+
# * Changed argument `pkg = "."` to `pkg = NULL to comply with CRAN policy requirements.`
17+
#
1218
# nocov start
1319

1420
# ------------------------------------------------------------------------------
@@ -35,7 +41,8 @@
3541
#' add_global_gitgnore()
3642
#' }
3743
#'
38-
add_global_gitgnore <- function(pkg = ".") {
44+
add_global_gitgnore <- function(pkg = NULL) {
45+
pkg <- pkg %||% "." # ! CHANGE
3946
# Template from Github
4047
# History files
4148
usethis::use_git_ignore(".Rproj.user", directory = pkg)

man/add_global_gitgnore.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)