hack/d/cli.sh: properly handle errors in curl

Add `-f` to output nothing to tar if the curl fails, and `-S` to report
errors if they happen.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
This commit is contained in:
Bjorn Neergaard 2023-07-17 09:51:29 -06:00
parent 12a19dcd84
commit 780e8b2332
No known key found for this signature in database

View file

@ -9,7 +9,7 @@ DOWNLOAD_URL="https://download.docker.com/linux/static/stable/$(xx-info march)/d
mkdir "$outdir"
if curl --head --silent --fail "${DOWNLOAD_URL}" 1> /dev/null 2>&1; then
curl -Ls "${DOWNLOAD_URL}" | tar -xz docker/docker
curl -fsSL "${DOWNLOAD_URL}" | tar -xz docker/docker
mv docker/docker "${outdir}/docker"
else
git init -q .