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