]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Make update_latest work with alpha, beta, etc. (#7177)
authorEvert Timberg <evert.timberg+github@gmail.com>
Thu, 5 Mar 2020 23:05:02 +0000 (18:05 -0500)
committerGitHub <noreply@github.com>
Thu, 5 Mar 2020 23:05:02 +0000 (18:05 -0500)
Make update_latest work with alpha, beta, etc.

scripts/deploy.sh

index f3212b4fccf9f46d1a635c172c4b6490f7241ea3..7c49968d1cbc3b8672abbb23c4922994a8064337 100755 (executable)
@@ -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 {