Chart.js/scripts/utils.sh

24 lines
498 B
Bash
Raw Normal View History

#!/bin/bash
# tag is next|latest|master|x.x.x
# https://www.chartjs.org/dist/$tag/
# https://www.chartjs.org/docs/$tag/
# https://www.chartjs.org/samples/$tag/
function tag_from_version {
local version=$1
local mode=$2
local tag=''
if [ "$version" == "master" ]; then
tag=master
elif [[ "$version" =~ ^[^-]+$ ]]; then
2021-04-04 15:26:41 +02:00
if [[ "$mode" == "release" ]]; then
tag=$version
else
tag=latest
fi
else
tag=next
fi
echo $tag
}