diff --git a/lib/functions/general/oci-oras.sh b/lib/functions/general/oci-oras.sh index 80445f1f1..cee7ba3cf 100644 --- a/lib/functions/general/oci-oras.sh +++ b/lib/functions/general/oci-oras.sh @@ -53,18 +53,18 @@ function run_tool_oras() { ;; esac - # Check if we have a cached version in a Docker image, and copy it over before possibly updating it. - if [[ "${deploy_to_non_cache_dir:-"no"}" != "yes" && -d "${non_cache_dir}" && ! -f "${ORAS_BIN}" ]]; then - display_alert "Using cached ORAS from Docker image" "ORAS" "debug" - run_host_command_logged cp "${non_cache_dir}/"* "${DIR_ORAS}/" - fi - declare ORAS_FN="oras_${ORAS_VERSION}_${ORAS_OS}_${ORAS_ARCH}" declare ORAS_FN_TARXZ="${ORAS_FN}.tar.gz" declare DOWN_URL="https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/${ORAS_FN_TARXZ}" declare ORAS_BIN="${DIR_ORAS}/${ORAS_FN}" declare ACTUAL_VERSION + # Check if we have a cached version in a Docker image, and copy it over before possibly updating it. + if [[ "${deploy_to_non_cache_dir:-"no"}" != "yes" && -d "${non_cache_dir}" && ! -f "${ORAS_BIN}" ]]; then + display_alert "Using cached ORAS from Docker image" "ORAS" "debug" + run_host_command_logged cp -r "${non_cache_dir}/"* "${DIR_ORAS}/" + fi + if [[ ! -f "${ORAS_BIN}" ]]; then do_with_retries 5 try_download_oras_tooling fi diff --git a/lib/functions/general/shellcheck.sh b/lib/functions/general/shellcheck.sh index 13709b73d..2cb46659f 100644 --- a/lib/functions/general/shellcheck.sh +++ b/lib/functions/general/shellcheck.sh @@ -92,18 +92,18 @@ function run_tool_shellcheck() { ;; esac - # Check if we have a cached version in a Docker image, and copy it over before possibly updating it. - if [[ "${deploy_to_non_cache_dir:-"no"}" != "yes" && -d "${non_cache_dir}" ]]; then - display_alert "Using cached SHELLCHECK from Docker image" "SHELLCHECK" "debug" - run_host_command_logged cp -v "${non_cache_dir}/"* "${DIR_SHELLCHECK}/" - fi - declare SHELLCHECK_FN="shellcheck-v${SHELLCHECK_VERSION}.${SHELLCHECK_OS}.${SHELLCHECK_ARCH}" declare SHELLCHECK_FN_TARXZ="${SHELLCHECK_FN}.tar.xz" declare DOWN_URL="https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/${SHELLCHECK_FN_TARXZ}" declare SHELLCHECK_BIN="${DIR_SHELLCHECK}/${SHELLCHECK_FN}" declare ACTUAL_VERSION + # Check if we have a cached version in a Docker image, and copy it over before possibly updating it. + if [[ "${deploy_to_non_cache_dir:-"no"}" != "yes" && -d "${non_cache_dir}" && ! -f "${SHELLCHECK_BIN}" ]]; then + display_alert "Using cached SHELLCHECK from Docker image" "SHELLCHECK" "debug" + run_host_command_logged cp -v "${non_cache_dir}/"* "${DIR_SHELLCHECK}/" + fi + if [[ ! -f "${SHELLCHECK_BIN}" ]]; then do_with_retries 5 try_download_shellcheck_tooling fi