Skip to content

Commit

Permalink
fix temp dir behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kotov committed Aug 20, 2024
1 parent 17c2de9 commit 9c91a47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/java_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ java_download <- function(
if (temp_dir) {
temp_dir <- tempdir()
setwd(temp_dir)
dir.create("rJavaEnv_cache", recursive = TRUE)
if (!dir.exists("rJavaEnv_cache")) {
dir.create("rJavaEnv_cache", recursive = TRUE)
}
cache_path <- file.path(temp_dir, "rJavaEnv_cache")
}

Expand Down
8 changes: 6 additions & 2 deletions R/java_quick_install.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ java_quick_install <- function(
if (temp_dir) {
temp_dir <- tempdir()
setwd(temp_dir)
dir.create("rJavaEnv_cache", recursive = TRUE)
if (!dir.exists("rJavaEnv_cache")) {
dir.create("rJavaEnv_cache", recursive = TRUE)
}
cache_path <- file.path(temp_dir, "rJavaEnv_cache")
dir.create("rJavaEnv_project", recursive = TRUE)
if (!dir.exists("rJavaEnv_project")) {
dir.create("rJavaEnv_project", recursive = TRUE)
}
project_path <- file.path(temp_dir, "rJavaEnv_project")
} else {
cache_path <- getOption("rJavaEnv.cache_path")
Expand Down

0 comments on commit 9c91a47

Please sign in to comment.