File: get-git-version

package info (click to toggle)
claws-mail 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,264 kB
  • sloc: ansic: 269,620; cpp: 19,478; xml: 11,545; sh: 6,285; perl: 2,767; makefile: 2,504; yacc: 2,471; python: 334; lex: 293; sed: 16
file content (17 lines) | stat: -rwxr-xr-x 426 bytes parent folder | download | duplicates (4)
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=`command -v 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