From b778a111020f2d27a1df37e7acf00252127dc1fd Mon Sep 17 00:00:00 2001 From: Hugo Gruson <10783929+Bisaloo@users.noreply.github.com> Date: Thu, 28 Aug 2025 22:22:52 +0200 Subject: [PATCH 1/2] Replace rappdirs by tools::R_user_dir() --- R/oauth.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/oauth.R b/R/oauth.R index d9888e40..1143437c 100644 --- a/R/oauth.R +++ b/R/oauth.R @@ -211,7 +211,7 @@ oauth_cache_path <- function() { return(path) } - rappdirs::user_cache_dir("httr2") + tools::R_user_dir("httr2", which = "cache") } From f7f1f6a21be982e1c33deb8824337a46f52447c1 Mon Sep 17 00:00:00 2001 From: Hugo Gruson <10783929+Bisaloo@users.noreply.github.com> Date: Thu, 28 Aug 2025 22:23:33 +0200 Subject: [PATCH 2/2] Use nzchar() to test for path existence --- R/oauth.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/oauth.R b/R/oauth.R index 1143437c..aba8ebe3 100644 --- a/R/oauth.R +++ b/R/oauth.R @@ -207,7 +207,7 @@ cache_disk_prune <- function(days = 30, path = oauth_cache_path()) { #' @export oauth_cache_path <- function() { path <- Sys.getenv("HTTR2_OAUTH_CACHE") - if (path != "") { + if (nzchar(path)) { return(path) }