From b16f1fc260cd5db2243c4a0ce337d30c2793ed4c Mon Sep 17 00:00:00 2001 From: Jakub Baron Date: Tue, 21 Sep 2021 12:33:14 +0100 Subject: [PATCH] feature: let user specify what version of flux-cli they want to install Signed-off-by: Jakub Baron --- install/flux.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install/flux.sh b/install/flux.sh index 9ac1790d..496f2158 100755 --- a/install/flux.sh +++ b/install/flux.sh @@ -87,7 +87,13 @@ setup_tmp() { # Find version from Github metadata get_release_version() { - METADATA_URL="https://api.github.com/repos/${GITHUB_REPO}/releases/latest" + if [[ -n "${FLUX_VERSION}" ]]; then + SUFFIX_URL="tags/v${FLUX_VERSION}" + else + SUFFIX_URL="latest" + fi + + METADATA_URL="https://api.github.com/repos/${GITHUB_REPO}/releases/${SUFFIX_URL}" info "Downloading metadata ${METADATA_URL}" download "${TMP_METADATA}" "${METADATA_URL}"