From be208e095f86333399660ff88ca810faf88f63b9 Mon Sep 17 00:00:00 2001 From: Amanda McCann Date: Mon, 19 Feb 2024 13:13:32 +0100 Subject: [PATCH] stop curl from printing a warning when this is run for the first time --- CHANGELOG.md | 1 + get-shapefiles.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cde460..275d859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Unreleased * Data URLs updated +* get-shapefiles doens't print warning on first run ## 1.0.0 (2023-03-28) diff --git a/get-shapefiles.sh b/get-shapefiles.sh index 64eaa3f..450beeb 100755 --- a/get-shapefiles.sh +++ b/get-shapefiles.sh @@ -8,7 +8,11 @@ function download_and_extract { START_DIR=$(pwd) cd data echo "Downloading $URL" - curl -z "$FILE" -LO "$URL" + CURL_TIME_COND_ARG="$FILE" + if [ ! -e "$FILE" ] ; then + CURL_TIME_COND_ARG="1 Jan 1970 00:00:00" + fi + curl --time-cond "$CURL_TIME_COND_ARG" -LO "$URL" unzip -o -u "$FILE" cd "$START_DIR" }