diff options
author | Michele Papalini <micpapal+fdio@cisco.com> | 2017-02-24 08:00:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2017-02-24 08:00:13 +0000 |
commit | 6d4b6878ceff22f9ec8d8e9423214f9666007472 (patch) | |
tree | fa27e0c747676519cb87ff8448bfed62fce5009d /libccnx-common/cmake/get_version.sh | |
parent | f28308bd99381ef5f1e178e2e1f870f245e35873 (diff) | |
parent | d18ae43123fcd7604d1c36a1ec8450dbe6071824 (diff) |
Merge "Initial commit: ccnxlibs." into ccnxlibs/master
Diffstat (limited to 'libccnx-common/cmake/get_version.sh')
-rwxr-xr-x | libccnx-common/cmake/get_version.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libccnx-common/cmake/get_version.sh b/libccnx-common/cmake/get_version.sh new file mode 100755 index 00000000..34c6ddb2 --- /dev/null +++ b/libccnx-common/cmake/get_version.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +DATE_VERSION=`date "+%Y%m%d"` + +if [ ! -d $1 ]; then + echo 0.$DATE_VERSION + exit +fi + +if [ -f $1/BASE_VERSION ]; then + BASE_VERSION=`cat $1/BASE_VERSION`. +fi + +GIT=`which git` + +if test -x $GIT -a -f $1/.git/config; then + GIT_VERSION=.`git -C $1 rev-parse HEAD | cut -c 1-8` +fi + +echo $BASE_VERSION$DATE_VERSION$GIT_VERSION |