From 6836e514bf2619ee926b0b85996324f8851bc6c2 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Thu, 5 Mar 2020 18:05:02 -0500 Subject: [PATCH] Make update_latest work with alpha, beta, etc. (#7177) Make update_latest work with alpha, beta, etc. --- scripts/deploy.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f3212b4fc..7c49968d1 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -20,10 +20,22 @@ fi function update_latest { local out_path=$1 + + # The most recent directory whose name is a version number local latest=($(ls -v $out_path | egrep '^('$VERSION_REGEX')$' | tail -1)) + + # As soon as a single version is deployed this line is a no-op if [ "$latest" == "" ]; then latest='master'; fi - rm -f $out_path/latest - ln -s $latest $out_path/latest + + # Don't update "latest" on alpha or beta releases + if [[ "$latest" =~ ^[^-]+$ ]]; then + rm -f $out_path/latest + ln -s $latest $out_path/latest + fi + + # Always update "next" + rm -f $out_path/next + ln -s $latest $out_path/next } function deploy_files { -- 2.47.2