hack/cli.sh: Quiet origin cleanup

Don't show `error: No such remote: 'origin'` error when building for the
first time and the cached git repository doesn't a remote yet.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-06-05 16:31:15 +02:00
parent 9aecb906fb
commit 5433b88e2d
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -13,7 +13,7 @@ if curl --head --silent --fail "${DOWNLOAD_URL}" 1> /dev/null 2>&1; then
mv docker/docker "${outdir}/docker"
else
git init -q .
git remote remove origin || true
git remote remove origin 2> /dev/null || true
git remote add origin "${repository}"
git fetch -q --depth 1 origin "${version}" +refs/tags/*:refs/tags/*
git checkout -fq "${version}"