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.
This commit is contained in:
Carl Anderson 2020-07-01 16:26:59 -05:00 committed by GitHub
parent 159e107f58
commit 52e1448ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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