From eb443bd4941c3334ee584c1915fcfa2001e8a86c Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 31 Aug 2025 10:31:45 +0800 Subject: [PATCH] feat: avoid redundant binary downloads and notify when skipping (#210) * 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 * Update entrypoint.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Signed-off-by: appleboy Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index bc99822..f9449e8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -39,8 +39,12 @@ if [[ "${INPUT_CURL_INSECURE}" == 'true' ]]; then INSECURE_OPTION="--insecure" fi -curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}" -chmod +x "${TARGET}" +if [[ ! -x "${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 and is executable, skipping download." +fi echo "======= CLI Version Information =======" "${TARGET}" --version