Fix CID 1596595: Resource leak
[claws.git] / get-git-version
blob1c105039ae0c9b632665cc035519bf15149a668b
1 #!/bin/sh
2 if test \( -d .git \); then
3 git=`which git`
4 if test \( -x "$git" \); then
5 version=`git describe --abbrev=6 --dirty --always`
6 echo "echo $version" > ./version
7 else
8 echo "Error: *** git not found. See http://git-scm.com/"
9 exit 1
11 elif test \( -s ./version \); then
12 version=`sh -c ". ./version"`
13 else
14 echo "Error: *** invalid tree. Neither '.git' nor 'version' were found"
15 exit 1
17 echo -n $version