From 52e1448ba52880456f9a5246416bb3a898ed0e63 Mon Sep 17 00:00:00 2001 From: Carl Anderson Date: Wed, 1 Jul 2020 16:26:59 -0500 Subject: [PATCH] Follow 302 redirects with curl I noticed that, after running this script, the jar file was only 144 bytes. Running the commented-out `wget` command worked for me, so I re-ran the `curl` command with `-v`. I noticed that the first response was a 302 redirect. It seemed that `curl` needs an extra nudge to follow redirects. Looking in the man page I found `-L`, which worked for me. --- _updatePublisher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_updatePublisher.sh b/_updatePublisher.sh index effde2e..babd762 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -58,7 +58,7 @@ fi if [[ "$FORCE" == true ]] || [[ "$response" =~ ^([yY])$ ]]; then echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit" # wget "https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar" -O "$jarlocation" - curl $dlurl -o "$jarlocation" --create-dirs + curl -L $dlurl -o "$jarlocation" --create-dirs else echo cancel... fi