From cd7ede5c7926690b3ab965e4be6bbb52cc95db77 Mon Sep 17 00:00:00 2001 From: xxxuuu Date: Fri, 11 Jul 2025 16:06:15 +0800 Subject: [PATCH] Update getm3fs.sh to fetch the latest m3fs version dynamically Signed-off-by: xxxuuu --- scripts/{getm3fs.sh => getm3fs} | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) rename scripts/{getm3fs.sh => getm3fs} (77%) diff --git a/scripts/getm3fs.sh b/scripts/getm3fs similarity index 77% rename from scripts/getm3fs.sh rename to scripts/getm3fs index ea4efb1..85c0e36 100755 --- a/scripts/getm3fs.sh +++ b/scripts/getm3fs @@ -40,24 +40,10 @@ if [ -z "${ARCH}" ]; then esac fi -# # Fetch latest version -# if [ "m${VERSION}" = "m" ]; then -# VERSION="$(curl -sL https://api.github.com/repos/open3fs/m3fs/releases | -# grep -o 'download/v[0-9]*.[0-9]*.[0-9]*/' | -# sort --version-sort | -# tail -1 | awk -F'/' '{ print $2}')" -# VERSION="${VERSION##*/}" -# fi +VERSION=$(basename $(curl -s -L -I -o /dev/null -w '%{url_effective}' "https://github.com/open3fs/m3fs/releases/latest")) +echo "The latest version of m3fs is ${VERSION}" -# if [ "m${VERSION}" = "m" ]; then -# echo "Unable to get latest version of m3fs. Set VERSION env var and re-run. For example: export VERSION=v1.0.0" -# echo "" -# exit -# fi - -VERSION="v0.2.0" DOWNLOAD_URL="https://artifactory.open3fs.com/m3fs/m3fs_${VERSION}_${ARCH}.tar.gz" - echo "" echo "Downloading m3fs ${VERSION} from ${DOWNLOAD_URL} ..." echo ""