9ae5a046969f62e6bb242d927fee750adc9fa01c
[bpt/coccinelle.git] / scripts / genversion.sh
1 #!/bin/sh
2
3 # fallback date (in RFC format)
4 VERSION=`date "+%a, %d %b %Y %H:%M:%S %z"`
5
6 # use the date information from git, if git is present
7 which git &>/dev/null
8 if [ $? -eq 0 ] && [ -d ".git" ]
9 then
10 VERSION=`git log -1 --date-order --date=rfc --pretty="format:%cd"`
11 fi
12
13 echo "let version_date = \"$VERSION\""