Skip to content

Commit

Permalink
record full date in DESCRIPTION
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Oct 21, 2024
1 parent 1fb1378 commit 413963c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions R/upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ upkeep_checklist <- function(target_repo = NULL) {
#' checklist
use_tidy_upkeep_issue <- function(year = last_upkeep_year()) {
make_upkeep_issue(year = NULL, last_year = year, tidy = TRUE)
record_upkeep_year(format(Sys.Date(), "%Y"))
record_upkeep_date(Sys.Date())
}

# for mocking
Expand Down Expand Up @@ -330,10 +330,15 @@ has_old_cran_comments <- function() {
any(grepl("# test environment", readLines(cc), ignore.case = TRUE))
}

last_upkeep_year <- function() {
last_upkeep_date <- function() {
as.Date(proj_desc()$get_field("Config/usethis/upkeep", "2000-01-01"), format = "%Y-%m-%d")
as.integer(proj_desc()$get_field("Config/usethis/upkeep", 2000L))
}

record_upkeep_year <- function(year) {
desc <- proj_desc_field_update("Config/usethis/upkeep", as.character(year))
last_upkeep_year <- function() {
as.integer(format(last_upkeep_date(), "%Y"))
}

record_upkeep_date <- function(date) {
desc <- proj_desc_field_update("Config/usethis/upkeep", format(date, "%Y-%m-%d"))
}

0 comments on commit 413963c

Please sign in to comment.