Skip to content

Commit

Permalink
Merge pull request #28 from amandasaurus/curl-err
Browse files Browse the repository at this point in the history
stop curl from printing a warning when this is run for the first time
  • Loading branch information
amandasaurus authored Feb 19, 2024
2 parents 2799f04 + be208e0 commit 57bdcb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Unreleased

* Data URLs updated
* get-shapefiles doens't print warning on first run

## 1.0.0 (2023-03-28)

Expand Down
6 changes: 5 additions & 1 deletion get-shapefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 57bdcb3

Please sign in to comment.