add record existence checks in read_all

This commit is contained in:
2021-08-09 18:38:56 +02:00
parent 4dbf90127a
commit 1152115a0f
3 changed files with 26 additions and 9 deletions
+2 -3
View File
@@ -42,9 +42,8 @@ fetch_batch <- function(offset, download_dir) {
#'
#' @export
fetch_all <- function(download_dir="inst/records/", create=FALSE) {
# check if download_dir path is a directory path
if (str_sub(download_dir, -1) != .Platform$file.sep)
download_dir <- str_c(download_dir, .Platform$file.sep)
# append file separator if needed
download_dir <- make_directory_path(download_dir)
check_directory(download_dir, create)
cat("Fetching all available records from bundestag.de. This may take a while ...\n")