diff options
Diffstat (limited to 'version.sh')
-rwxr-xr-x | version.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..a1c79f9 --- /dev/null +++ b/version.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +VERSION=`git describe --tags` +BRANCH=$(git branch | grep '^*' | sed 's/^\* //') + +if [[ $BRANCH != "master" ]] && [[ $BRANCH != "(no branch)" ]]; then + VERSION="$VERSION-$BRANCH" +fi + +echo -e "#ifndef __VERSION_H__\r\n#define __VERSION_H__\r\n\r\n#define MTDOT_BOX_VERSION \"$VERSION\"\r\n\r\n#endif" > version.h |