mirror of
https://github.com/appleboy/scp-action.git
synced 2025-09-09 19:25:23 +08:00
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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user