Remove data file also if yesterday's doesn't exist

This commit is contained in:
Michael De Roover 2020-05-14 16:57:04 +02:00
parent 1b5d4233c3
commit 11c28758a2
Signed by: vim
GPG Key ID: 075496E232CE04CB

13
cv
View File

@ -55,12 +55,7 @@ result(){
then then
show "Yesterday's stats:" show "Yesterday's stats:"
echo "New: $(yget todayCases)" echo "New: $(yget todayCases)"
if [ "$(get todayCases)" == "0" ] if [ "$(get todayCases)" == "$(yget todayCases)" ]
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 then
show "Seems like the stats are the same as yesterday." 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 "This could be normal but may mean that the data file is still yesterday's."
@ -74,6 +69,12 @@ result(){
else else
show "Yesterday's data file for this country doesn't exist." show "Yesterday's data file for this country doesn't exist."
fi 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" show "Queried at: $date"