Skip to content

Commit

Permalink
Merge pull request #733 from pascal-sauer/develop
Browse files Browse the repository at this point in the history
renv 1.0.11
  • Loading branch information
pascal-sauer authored Oct 16, 2024
2 parents c491be7 + 408062e commit 8a85fd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if (!"https://rse.pik-potsdam.de/r/packages" %in% getOption("repos")) {
# bootstrapping, will only run once after this repo is freshly cloned
if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) {
message("R package dependencies are not installed in this renv, installing now...")
renv::install("rmarkdown", prompt = FALSE) # rmarkdown is required to find dependencies in Rmd files
renv::hydrate(prompt = FALSE, report = FALSE) # auto-detect and install all dependencies
message("Finished installing R package dependencies.")
if (!("upstream" %in% gert::git_remote_list()$name)) {
Expand All @@ -37,5 +38,5 @@ if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) {

# in case bootstrapping fails halfway, install piamenv and rely on requirement auto-fixing
if (tryCatch(utils::packageVersion("piamenv") < "0.5.5", error = function(error) TRUE)) {
renv::install("piamenv", type = getOption("pkgType"), prompt = FALSE)
renv::install("piamenv", prompt = FALSE)
}
10 changes: 4 additions & 6 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local({

# the requested version of renv
version <- "1.0.9"
version <- "1.0.11"
attr(version, "sha") <- NULL

# the project directory
Expand Down Expand Up @@ -368,8 +368,7 @@ local({
quiet = TRUE
)

if ("headers" %in% names(formals(utils::download.file)))
{
if ("headers" %in% names(formals(utils::download.file))) {
headers <- renv_bootstrap_download_custom_headers(url)
if (length(headers) && is.character(headers))
args$headers <- headers
Expand Down Expand Up @@ -457,9 +456,8 @@ local({

# add custom headers if available -- note that
# utils::available.packages() will pass this to download.file()
if ("headers" %in% names(formals(utils::download.file)))
{
headers <- renv_bootstrap_download_custom_headers(url)
if ("headers" %in% names(formals(utils::download.file))) {
headers <- renv_bootstrap_download_custom_headers(repos)
if (length(headers) && is.character(headers))
args$headers <- headers
}
Expand Down

0 comments on commit 8a85fd1

Please sign in to comment.