Add submodules checkout
[mfgtools.git] / libuuu / gen_ver.sh
blobfe9ed8ad82f1ddf265c263a6d7ce1194e5202b2d
1 #!/bin/sh
3 # Input parameters
4 file_to_write="$1"
6 set -e
8 if [ -f ../.tarball-version ]
9 then
10 echo "#define GIT_VERSION \"lib$(cat ../.tarball-version)\"" > "$file_to_write"
11 exit 0
14 if [ "${APPVEYOR_BUILD_VERSION}" = "" ];
15 then
16 echo build not in appveyor
17 else
18 git tag uuu_${APPVEYOR_BUILD_VERSION}
21 # Test if we are in a repo
22 if [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ];
23 then
24 #echo "In a repo"
25 # Get the version of the last commit of the repo
26 version=`git describe --tags --long`
27 echo "#define GIT_VERSION \"lib$version\"" > $file_to_write