Skip to content

Commit

Permalink
Make update_latest work with alpha, beta, etc. (chartjs#7177)
Browse files Browse the repository at this point in the history
Make update_latest work with alpha, beta, etc.
  • Loading branch information
etimberg authored Mar 5, 2020
1 parent 788dbd4 commit 6836e51
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6836e51

Please sign in to comment.