diff --git a/cv b/cv index 120f479..a0d75a2 100755 --- a/cv +++ b/cv @@ -41,23 +41,28 @@ result(){ echo "Active: $(get active)" echo "New: $(get todayCases)" echo "Tests: $(get tests)" - show "Yesterday's stats:" - echo "New: $(yget todayCases)" - if [ $(get todayCases) == "0" ] + if [ -f $data/$ydate-$country ] 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) ] - 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." - show "Do you want to remove it?" - read -p "Answer (y/n): " answer - if [ "$answer" == "y" ] + 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) ] + 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." + show "Do you want to remove it?" + read -p "Answer (y/n): " answer + if [ "$answer" == "y" ] + then + ex "rm $data/$date-$country" + fi fi + else + show "Yesterday's data file for this country doesn't exist." fi }