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
parent
9132c85c5f
commit
775954b583
|
@ -39,8 +39,12 @@ if [[ "${INPUT_CURL_INSECURE}" == 'true' ]]; then
|
||||||
INSECURE_OPTION="--insecure"
|
INSECURE_OPTION="--insecure"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}"
|
if [[ ! -f "${TARGET}" ]]; then
|
||||||
chmod +x "${TARGET}"
|
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 ======="
|
echo "======= CLI Version Information ======="
|
||||||
"${TARGET}" --version
|
"${TARGET}" --version
|
||||||
|
|
Loading…
Reference in New Issue