From 543ffa5a17383e5cc4f11b5f3c865160b0de040f Mon Sep 17 00:00:00 2001 From: Josh Dolitsky Date: Thu, 4 Feb 2021 14:14:25 -0500 Subject: [PATCH] maint: fix version check in install script Signed-off-by: Josh Dolitsky --- scripts/get-chartmuseum | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/get-chartmuseum b/scripts/get-chartmuseum index afe6058e..8c859ccb 100755 --- a/scripts/get-chartmuseum +++ b/scripts/get-chartmuseum @@ -119,7 +119,10 @@ checkDesiredVersion() { # if it needs to be changed. checkChartmuseumInstalledVersion() { if [[ -f "${CHARTMUSEUM_INSTALL_DIR}/${BINARY_NAME}" ]]; then - local version=v$("${CHARTMUSEUM_INSTALL_DIR}/${BINARY_NAME}" version | awk '{print $3}') + local version=$("${CHARTMUSEUM_INSTALL_DIR}/${BINARY_NAME}" --version | awk '{print $3}') + if [[ ! "${version}" =~ ^v.* ]]; then + version="v${version}" # fix for older versions + fi if [[ "$version" == "$TAG" ]]; then echo "ChartMuseum ${version} is already ${DESIRED_VERSION:-latest}" return 0