File: git-version.sh

package info (click to toggle)
bart 0.9.00-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,040 kB
  • sloc: ansic: 116,116; python: 1,329; sh: 726; makefile: 639; javascript: 589; cpp: 106
file content (15 lines) | stat: -rwxr-xr-x 289 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

if test -d ${GIT_DIR:-.git} -o -f .git
then
    git describe --abbrev=7 --match "v*" --dirty
    if [[ $? -eq 0 ]]; then
	git describe --abbrev=7 --match "v*" | cut -f1 -d'-' > version.txt
    else
	var=`cat version.txt`
	echo ${var}-dirty
    fi
else
    cat version.txt
fi