Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tanho63 committed Jan 25, 2022
2 parents c1c91bf + 95ed6c7 commit f94223f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions update/ep_update.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ upload_ep_data <- function(folder_path, version){
cli::cli_alert_success("Completed ep upload! {Sys.time()}")
}

update_ep <- function(season, version = "v1.0.0"){
update_ep <- function(season, version = "v1.0.0", folder_path){
try(piggyback::pb_new_release(repo = "ffverse/ffexpectedpoints", tag = "latest-data"))
try(piggyback::pb_new_release(repo = "ffverse/ffexpectedpoints", tag = glue::glue("{version}-data")))
folder_path <- tempdir()
on.exit(unlink(folder_path, recursive = TRUE, force = TRUE))
purrr::walk(season, save_ep_data, folder_path = folder_path, version = version)
upload_ep_data(folder_path, version)
invisible(NULL)
}
temp <- tempdir()
update_ep(nflreadr:::most_recent_season(), version = "latest", folder_path = temp)
update_ep(nflreadr:::most_recent_season(), version = "v1.0.0", folder_path = temp)

unlink(temp, recursive = TRUE, force = TRUE)

update_ep(nflreadr:::most_recent_season(), version = "latest")
update_ep(nflreadr:::most_recent_season(), version = "v1.0.0")

0 comments on commit f94223f

Please sign in to comment.