File: git-version.sh

package info (click to toggle)
bart-cuda 0.8.00-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm, sid
  • size: 7,752 kB
  • sloc: ansic: 100,267; python: 717; makefile: 576; sh: 564; cpp: 104
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