File: get-git-version

package info (click to toggle)
claws-mail 4.1.1-2~bpo11%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye-backports
  • size: 49,132 kB
  • sloc: ansic: 268,486; cpp: 14,588; xml: 11,220; sh: 5,698; perl: 2,767; yacc: 2,470; makefile: 2,470; python: 334; lex: 293
file content (17 lines) | stat: -rwxr-xr-x 439 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
if test \( -d .git \); then
  git=`which git`
  if test \( -x "$git" \); then
    version=`git describe --abbrev=6 --dirty --always`
    echo "echo $version" > ./version
  else
    echo "Error: *** git not found. See http://git-scm.com/"
    exit 1
  fi
elif test \( -s ./version \); then
  version=`sh -c ". ./version"`
else
  echo "Error: *** invalid tree. Neither '.git' nor 'version' were found"
  exit 1
fi
echo -n $version