Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
regions_meow and regions_fao: create base dir if does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jun 10, 2021
1 parent 6944d58 commit 24fb2d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/ecoregion.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ eco_region <- function(x, dataset = "meow", region,
#' @rdname eco_region
regions_meow <- function() {
path <- file.path(scrubr_cache$cache_path_get(), "meow.geojson")
dir.create(dirname(path), showWarnings = FALSE, recursive = TRUE)
if (file.exists(path)) {
message("meow.geojson exists in the cache")
} else {
Expand All @@ -125,6 +126,7 @@ regions_meow <- function() {
#' @rdname eco_region
regions_fao <- function() {
path <- file.path(scrubr_cache$cache_path_get(), "fao.geojson")
dir.create(dirname(path), showWarnings = FALSE, recursive = TRUE)
if (file.exists(path)) {
message("fao.geojson exists in the cache")
} else {
Expand Down

0 comments on commit 24fb2d8

Please sign in to comment.