From 7f2f2dddc297be744d8641302fdf28de4bd87f4b Mon Sep 17 00:00:00 2001 From: Jason Garber Date: Thu, 10 Oct 2024 15:10:54 -0400 Subject: [PATCH] Convert "latest" to version string --- src/google-cloud-cli/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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