diff --git a/cv b/cv index fcc5a87..ac1899d 100755 --- a/cv +++ b/cv @@ -4,8 +4,8 @@ ex(){ echo -e "> ${*}" $@ } -date=$(date +"%Y-%m-%d") -ydate=$(date -d yesterday +"%Y-%m-%d") +[ -z $date ] && date=$(date +"%Y-%m-%d") +[ -z $ydate ] && ydate=$(date -d yesterday +"%Y-%m-%d") title(){ w=36 printf "║ %-${w}s ║\n" "${*}" @@ -63,10 +63,23 @@ result(){ out Recovered recovered out Tests tests out "╰> Per 1M" testsPerOneMillion - if [ ! -f $data/$ydate-$country ] + if [ ! -f $data/$ydate-$country ] || [ $(get todayCases) == "0" ] then frame line - title "Stats for $country appear new." + if [ ! -f $data/$ydate-$country ] + then + title "Stats for $country appear new." + fi + if [ $(get todayCases) == "0" ] + then + if [ -z $norm ] + then + title "New cases are 0. Removing data file." + rm $data/$date-$country + else + title "New cases are 0. Keeping data file." + fi + fi frame bot else frame down