Skip to content

Commit eb443bd

Browse files
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 <appleboy.tw@gmail.com> * Update entrypoint.sh Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Signed-off-by: appleboy <appleboy.tw@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 9132c85 commit eb443bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ if [[ "${INPUT_CURL_INSECURE}" == 'true' ]]; then
3939
INSECURE_OPTION="--insecure"
4040
fi
4141

42-
curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}"
43-
chmod +x "${TARGET}"
42+
if [[ ! -x "${TARGET}" ]]; then
43+
curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}"
44+
chmod +x "${TARGET}"
45+
else
46+
echo "Binary ${CLIENT_BINARY} already exists and is executable, skipping download."
47+
fi
4448

4549
echo "======= CLI Version Information ======="
4650
"${TARGET}" --version

0 commit comments

Comments
 (0)