X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=update.sh;h=ace8592a60902c614e510a2b6020621981b734f2;hb=0c72202485d4042624ee6523c0c751c73d031a7d;hp=57ecf89d056395bf704c3ead01f945d118c7a597;hpb=6771de0510415071eeddf46e698ff6ba5234583d;p=berlin-corona-table diff --git a/update.sh b/update.sh index 57ecf89..ace8592 100755 --- a/update.sh +++ b/update.sh @@ -18,5 +18,11 @@ curl "${CSV_URL}" \ 'END { printf "\n" }' "${filename}" >> "${table_path}" # Write enhanced table output to directory served by web server. -./enhance_table.py "${table_path}" txt > /var/www/html/berlin_corona.txt -./enhance_table.py "${table_path}" html > /var/www/html/berlin_corona.html +# +# Use intermediate /tmp/ step so we don't overwrite a valid previous output with +# the emptiness delivered to stdout on any error, before such an error would +# kill this script due to "set -e". +./enhance_table.py "${table_path}" html > /tmp/berlin_corona.html +./enhance_table.py "${table_path}" txt > /tmp/berlin_corona.txt +mv /tmp/berlin_corona.html /var/www/html/ +mv /tmp/berlin_corona.txt /var/www/html/