Change data directory

This commit is contained in:
Michael De Roover 2020-05-02 15:01:11 +02:00
parent 545ffb989c
commit 00144d8b97
Signed by: vim
GPG Key ID: 075496E232CE04CB

15
cv
View File

@ -11,20 +11,22 @@ else
}
fi
if [ ! -d /tmp/cv ]
data="$HOME/Documents/cv"
if [ ! -d $data ]
then
mkdir /tmp/cv
ex "mkdir $data"
fi
country=$1
get(){
if [ -f /tmp/cv/$date-$country ]
if [ -f $data/$date-$country ]
then
cat /tmp/cv/$date-$country
cat $data/$date-$country
else
curl -sL corona.lmao.ninja/v2/$endpoint > /tmp/cv/$date-$country
cat /tmp/cv/$date-$country
curl -sL corona.lmao.ninja/v2/$endpoint > $data/$date-$country
cat $data/$date-$country
fi
}
result(){
@ -46,6 +48,7 @@ then
result
fi
else
# Change this to your own country as desired.
country=Belgium
show "Country has been set to $country."
endpoint=countries/$country