File: utils.sh

package info (click to toggle)
node-chart.js 3.9.1%2B~cs3.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 28,692 kB
  • sloc: javascript: 72,443; sh: 98; makefile: 11
file content (23 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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
      if [[ "$mode" == "release" ]]; then
        tag=$version
      else
        tag=latest
      fi
    else
        tag=next
    fi
    echo $tag
}