From a4f4b5645945b4b1cf18678110d1f7ed8a2b86fe Mon Sep 17 00:00:00 2001 From: Dan Kessler Date: Fri, 22 May 2020 16:09:16 -0400 Subject: [PATCH] recursively create cache directory This should fix #60. As discussed in the links from that issue, by default ESS turns on caching, which causes lintr to try to create a subdirectory inside of ~/.R. However, if ~/.R doesn't exist in the first place, dir.create will fail and lintr will not work in emacs. By adding the recursive = TRUE argument to dir.create, this will now create all parent directories as necessary to create the desired cache. --- R/cache.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/cache.R b/R/cache.R index 9e78fb1f6..a963b6a30 100644 --- a/R/cache.R +++ b/R/cache.R @@ -51,7 +51,7 @@ save_cache <- function(cache, file, path = NULL) { } if (!file.exists(path)) { - dir.create(path) + dir.create(path, recursive = TRUE) } save(file = get_cache_file_path(file, path), envir = cache, list = ls(envir = cache))