summaryrefslogtreecommitdiff
path: root/version.sh
blob: 9b53415ad26812c0eac5694aca385bcb6157af7c (plain)
1
2
3
4
5
6
7
8
9
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" > dotbox_version.h