Skip to content

Commit 7f2f2dd

Browse files
Convert "latest" to version string
1 parent aeee380 commit 7f2f2dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/google-cloud-cli/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.clou
3232
apt-get update --yes
3333

3434
if [ "${GOOGLE_CLOUD_CLI_VERSION}" = "latest" ]; then
35-
apt-get install --no-install-recommends --yes google-cloud-cli
36-
else
37-
apt-get install --no-install-recommends --yes google-cloud-cli="${GOOGLE_CLOUD_CLI_VERSION}"
35+
GOOGLE_CLOUD_CLI_VERSION="$(apt show google-cloud-cli 2>/dev/null | sed -nr 's/version: (.+)/\1/ip' | tr -d '\r')"
3836
fi
3937

38+
apt-get install --no-install-recommends --yes google-cloud-cli="${GOOGLE_CLOUD_CLI_VERSION}"
39+
4040
if [ -n "${curl_installed}" ]; then
4141
apt purge curl --autoremove --yes
4242
fi

0 commit comments

Comments
 (0)