Remove file removal logic
This commit is contained in:
parent
8ac1db42bc
commit
3f298d26e5
28
cv
28
cv
@ -6,9 +6,6 @@ ex(){
|
|||||||
}
|
}
|
||||||
date=$(date +"%Y-%m-%d")
|
date=$(date +"%Y-%m-%d")
|
||||||
ydate=$(date -d yesterday +"%Y-%m-%d")
|
ydate=$(date -d yesterday +"%Y-%m-%d")
|
||||||
show(){
|
|
||||||
echo -e "> ${*}"
|
|
||||||
}
|
|
||||||
title(){
|
title(){
|
||||||
w=36
|
w=36
|
||||||
printf "║ %-${w}s ║\n" "${*}"
|
printf "║ %-${w}s ║\n" "${*}"
|
||||||
@ -57,30 +54,7 @@ result(){
|
|||||||
out Tests tests
|
out Tests tests
|
||||||
out "╰> Per 1M" testsPerOneMillion
|
out "╰> Per 1M" testsPerOneMillion
|
||||||
frame down
|
frame down
|
||||||
if [ -f "$data/$ydate-$country" ]
|
|
||||||
then
|
|
||||||
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."
|
|
||||||
show "Do you want to remove it?"
|
|
||||||
read -rp "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
|
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
frame top
|
frame top
|
||||||
title "Queried at: $date"
|
title "Queried at: $date"
|
||||||
if [ ! -z "$country" ]
|
if [ ! -z "$country" ]
|
||||||
@ -100,3 +74,5 @@ else
|
|||||||
endpoint=countries/$country
|
endpoint=countries/$country
|
||||||
result
|
result
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Note: all file removal logic is removed."
|
||||||
|
Reference in New Issue
Block a user