From 11c28758a2964d47ec29a64ea711c10d61be9e02 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Thu, 14 May 2020 16:57:04 +0200 Subject: [PATCH] Remove data file also if yesterday's doesn't exist --- cv | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cv b/cv index d69ba3d..d9e3152 100755 --- a/cv +++ b/cv @@ -55,12 +55,7 @@ result(){ then show "Yesterday's stats:" echo "New: $(yget todayCases)" - if [ "$(get todayCases)" == "0" ] - then - show "Seems like the cases today are not yet updated." - show "The data file will be removed. Please query again later." - ex "rm $data/$date-$country" - elif [ "$(get todayCases)" == "$(yget todayCases)" ] + if [ "$(get todayCases)" == "$(yget todayCases)" ] then show "Seems like the stats are the same as yesterday." show "This could be normal but may mean that the data file is still yesterday's." @@ -74,6 +69,12 @@ result(){ else show "Yesterday's data file for this country doesn't exist." fi + if [ "$(get todayCases)" == "0" ] + then + show "Seems like the cases today are not yet updated." + show "The data file will be removed. Please try again later." + ex "rm $data/$date-$country" + fi } show "Queried at: $date"