Skip to content

Commit 8e01a58

Browse files
committed
update test_datatable_urls_doi to warn if ezEML inserted function = "download"
1 parent c949eb7 commit 8e01a58

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

R/tabular_data_congruence.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,15 @@ test_datatable_urls_doi <- function (metadata = load_metadata(directory)) {
431431
cli::cli_abort(c("x" = "One or more data files lack URLs. Could not test whether URLs are properly formatted or correspond to the corect DOI. Use {.fn EMLeditor::set_data_urls} to add them."))
432432
return(invisible(metadata))
433433
}
434+
434435
#handle <url function="download> tag from ezEML:
435436
if (length(seq_along(url)) > 1) {
436-
url <- url$url
437+
bad_url <- bad_url + 1
438+
tbl_name <- data_tbl[[i]][["physical"]][["objectName"]]
439+
cli::cli_warn(c("!" = "Metadata URL for the data table {.var {tbl_name}} is incorrectly formatted. Use {.fn EMLeditor::set_data_urls} to update the URLs."))
440+
return(invisible(metadata))
437441
}
442+
438443
prefix <- stringr::str_sub(url, 1, stringr::str_length(url)-7)
439444
suffix <- stringr::str_sub(url, -7, -1)
440445

0 commit comments

Comments
 (0)