Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and lorenzwalthert committed Nov 20, 2023
1 parent 42e7cd3 commit 4515c67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ repos:
inst/hooks/exported/pkgdown.R|
tests/testthat/in/.*|
inst/renv-update\.R|
inst/update-ppm-url.R|
inst/update-dependency-graph-existing-packages\.R|
inst/update-existing-hook-dependencies\.R|
renv/activate.R|
Expand Down
8 changes: 4 additions & 4 deletions inst/update-ppm-url.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# old binaries only guaranteed to be available for frozen snapshot
# https://community.rstudio.com/t/binary-packages-removed-once-new-package-version-released-on-ppm/177282/2
lockfile = renv::lockfile_read()
rspm_url = lockfile$R$Repositories$RSPM
lockfile <- renv::lockfile_read()
rspm_url <- lockfile$R$Repositories$RSPM
current_date <- Sys.Date() - 3 # available for sure

to_substract <- max(0, as.integer(strftime(current_date,'%u')) - 5)
to_substract <- max(0, as.integer(strftime(current_date, "%u")) - 5)
ensured_weekday <- current_date - to_substract
cat(paste0("Snapshot day for PPM moved to ", ensured_weekday))
updated_url <- gsub("[0-9]{4}-[0-9]{2}-[0-9]{2}$", ensured_weekday, rspm_url)
lockfile$R$Repositories$RSPM <- updated_url
renv::lockfile_write(lockfile = lockfile)
cat(paste0("Snapshot day for PPM moved to ", ensured_weekday))

0 comments on commit 4515c67

Please sign in to comment.