Fix issue with querying yesterday's stats without a data file
This commit is contained in:
31
cv
31
cv
@@ -41,23 +41,28 @@ result(){
|
|||||||
echo "Active: $(get active)"
|
echo "Active: $(get active)"
|
||||||
echo "New: $(get todayCases)"
|
echo "New: $(get todayCases)"
|
||||||
echo "Tests: $(get tests)"
|
echo "Tests: $(get tests)"
|
||||||
show "Yesterday's stats:"
|
if [ -f $data/$ydate-$country ]
|
||||||
echo "New: $(yget todayCases)"
|
|
||||||
if [ $(get todayCases) == "0" ]
|
|
||||||
then
|
then
|
||||||
show "Seems like the cases today are not yet updated."
|
show "Yesterday's stats:"
|
||||||
show "The data file will be removed. Please query again later."
|
echo "New: $(yget todayCases)"
|
||||||
ex "rm $data/$date-$country"
|
if [ $(get todayCases) == "0" ]
|
||||||
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
|
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"
|
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
|
fi
|
||||||
|
else
|
||||||
|
show "Yesterday's data file for this country doesn't exist."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user