diff --git a/src/google-cloud-cli/install.sh b/src/google-cloud-cli/install.sh index f573d54..6a66a18 100755 --- a/src/google-cloud-cli/install.sh +++ b/src/google-cloud-cli/install.sh @@ -32,11 +32,11 @@ echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.clou apt-get update --yes if [ "${GOOGLE_CLOUD_CLI_VERSION}" = "latest" ]; then - apt-get install --no-install-recommends --yes google-cloud-cli -else - apt-get install --no-install-recommends --yes google-cloud-cli="${GOOGLE_CLOUD_CLI_VERSION}" + GOOGLE_CLOUD_CLI_VERSION="$(apt show google-cloud-cli 2>/dev/null | sed -nr 's/version: (.+)/\1/ip' | tr -d '\r')" fi + apt-get install --no-install-recommends --yes google-cloud-cli="${GOOGLE_CLOUD_CLI_VERSION}" + if [ -n "${curl_installed}" ]; then apt purge curl --autoremove --yes fi