diff --git a/NEWS.md b/NEWS.md index dbf880d..439aa47 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# hydrolook 0.2.1 +* `report_network_diagnostic` now asks for permission to download station history record. + # hydrolook 0.2.0 * general package tidying; removing many package dependencies * added travis diff --git a/R/report_net_diagnostic.R b/R/report_net_diagnostic.R index 611477e..ef2e2c1 100644 --- a/R/report_net_diagnostic.R +++ b/R/report_net_diagnostic.R @@ -76,7 +76,11 @@ report_net_diagnostic <- function(output_type = "pdf", PROV_TERR_STATE_LOC = "BC ## Only output status if rendering is successful ## Carry forward the answer until after the rendering - if(ans) readr::write_csv(wo_status, file.path("report/net_diag", "water_office_record.csv")) + if(exists("ans")){ + if(ans == TRUE){ + readr::write_csv(wo_status, file.path("report/net_diag", "water_office_record.csv")) + } + }