File: version

package info (click to toggle)
tools-deps-clojure 0.21.1460-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 948 kB
  • sloc: xml: 158; sh: 37; makefile: 14
file content (17 lines) | stat: -rwxr-xr-x 352 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

set -e

version_template=`cat VERSION_TEMPLATE`
commit_count=`git rev-list HEAD --count`

if [[ "$version_template" =~ ^[0-9]+\.[0-9]+\.GENERATED_VERSION(-[a-zA-Z0-9]+)?$ ]]; then

    echo ${version_template/GENERATED_VERSION/$commit_count}

else
    echo "Invalid version template string: $version_template" >&2
    exit -1
fi