Skip to content

Commit

Permalink
single warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ginberg committed Jul 21, 2023
1 parent 66d37ac commit 15d4249
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/Connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ getDatabaseFile <- function(datasetName,

if (is.null(pathToData) || is.na(pathToData) || pathToData == "") {
pathToData <- tempdir()
warning("The pathToData argument is not specified. Consider setting the EUNOMIA_DATA_FOLDER environment variable, for example in the .Renviron file.")
rlang::warn("The pathToData argument is not specified. Consider setting the EUNOMIA_DATA_FOLDER environment variable, for example in the .Renviron file.", .frequency = c("once"), .frequency_id = "data_folder")
}

stopifnot(is.character(dbms), length(dbms) == 1, dbms %in% c("sqlite", "duckdb"))
Expand Down Expand Up @@ -122,7 +122,7 @@ getDatabaseFile <- function(datasetName,
datasetAvailable <- TRUE
}

rc <- file.copy(from = datasetLocation, to = databaseFile)
rc <- file.copy(from = datasetLocation, to = databaseFile, overwrite = TRUE)
if (isFALSE(rc)) {
stop(paste("File copy from", datasetLocation, "to", databaseFile, "failed!"))
}
Expand Down
2 changes: 1 addition & 1 deletion R/EunomiaData.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ downloadEunomiaData <- function(datasetName,
overwrite = FALSE) {
if (is.null(pathToData) || is.na(pathToData) || pathToData == "") {
pathToData <- tempdir()
warning("The pathToData argument is not specified. Consider setting the EUNOMIA_DATA_FOLDER environment variable, for example in the .Renviron file.")
rlang::warn("The pathToData argument is not specified. Consider setting the EUNOMIA_DATA_FOLDER environment variable, for example in the .Renviron file.", .frequency = c("once"), .frequency_id = "data_folder")
}

if (is.null(datasetName) || is.na(datasetName) || datasetName == "") {
Expand Down

0 comments on commit 15d4249

Please sign in to comment.