Skip to content

Commit

Permalink
recursively create cache directory
Browse files Browse the repository at this point in the history
This should fix r-lib#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.
  • Loading branch information
dankessler committed May 22, 2020
1 parent 3a7ec5c commit a4f4b56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit a4f4b56

Please sign in to comment.