From 00144d8b971a79782a2aa9a57f8b131f8cbeb251 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Sat, 2 May 2020 15:01:11 +0200 Subject: [PATCH] Change data directory --- cv | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cv b/cv index 79f67c4..e8a749e 100755 --- a/cv +++ b/cv @@ -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