diff --git a/R/load_taxonomic_resources.R b/R/load_taxonomic_resources.R index 0a0212a..7039625 100644 --- a/R/load_taxonomic_resources.R +++ b/R/load_taxonomic_resources.R @@ -411,8 +411,13 @@ default_version <- function() { # Pull out versions versions <- unique(release_data$tag_name) - # Exclude Taxonomy: first upload - dplyr::first(versions) + # Exclude rough semantic versions + cleaned_versions <- versions[!grepl("^\\d+\\.\\d+\\.\\d+(\\.\\d+)?$", versions)] + + # Verify only dates left + if(all(grepl("^\\d{4}-\\d{2}-\\d{2}$", cleaned_versions))) + sort(cleaned_versions, decreasing = TRUE) |> #Sort from most recent to oldest + dplyr::first() # and take the first value after sorting } }