Skip to content

Commit

Permalink
Fix default on catr_clear_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed May 27, 2022
1 parent d9cf8d3 commit cb85d96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CatastRo 0.2.2

- Add **tidyterra** to ‘Suggests’
- Add **tidyterra** to 'Suggests'.
- Fix #26: Now `catr_get_code_from_coords()` handle `sfc` objects.
- `catr_clear_cache()` now has `config = FALSE` ad default parameter.

# CatastRo 0.2.1

Expand Down
19 changes: 0 additions & 19 deletions R/cache_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,6 @@ catr_set_cache_dir <- function(cache_dir,
return(invisible(cache_dir))
}

catr_clear_cache <- function(config = TRUE,
cached_data = TRUE,
verbose = FALSE) {
config_dir <- rappdirs::user_config_dir("CatastRo", "R")
data_dir <- catr_hlp_detect_cache_dir()
if (config && dir.exists(config_dir)) {
unlink(config_dir, recursive = TRUE, force = TRUE)
if (verbose) message("CatastRo cache config deleted")
}

if (cached_data && dir.exists(data_dir)) {
unlink(data_dir, recursive = TRUE, force = TRUE, expand = TRUE)
if (verbose) message("CatastRo cached data deleted: ", data_dir)
}


Sys.setenv(CATASTROESP_CACHE_DIR = "")
return(invisible())
}

#' Detect cache dir for CatastRo
#'
Expand Down
2 changes: 1 addition & 1 deletion man/catr_clear_cache.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb85d96

Please sign in to comment.