1 parent 49aeeb7 commit 2845e47Copy full SHA for 2845e47
1 file changed
tests/testthat/setup-pak.R
@@ -0,0 +1,7 @@
1
+# pak (via pkgcache) requires a user cache directory.
2
+# In CI environments or during R CMD check, this might not be set,
3
+# causing pak subprocesses to fail.
4
+if (Sys.getenv("R_USER_CACHE_DIR") == "") {
5
+ # Use a temporary directory for the cache during tests
6
+ Sys.setenv(R_USER_CACHE_DIR = tempfile("pak-cache-"))
7
+}
0 commit comments