feat: avoid redundant binary downloads and notify when skipping

- Skip downloading the binary if it already exists, and print a message instead

Signed-off-by: appleboy <appleboy.tw@gmail.com>
pull/210/head
appleboy 2025-08-31 10:10:22 +08:00
parent 9132c85c5f
commit 775954b583
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -39,8 +39,12 @@ if [[ "${INPUT_CURL_INSECURE}" == 'true' ]]; then
INSECURE_OPTION="--insecure"
fi
if [[ ! -f "${TARGET}" ]]; then
curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}"
chmod +x "${TARGET}"
else
echo "Binary ${CLIENT_BINARY} already exists, skipping download."
fi
echo "======= CLI Version Information ======="
"${TARGET}" --version