#!/bin/bash
VERSION=$(cat VERSION)
REV=$(git rev-parse HEAD)
git diff-files --quiet --ignore-submodules || \
git diff-index --cached --quiet HEAD --ignore-submodules
if [ $? ]; then
    REV="${REV}+"
fi
cat << EOF > jujubigdata/version.py
VERSION = '${VERSION}'
REVISION = '${REV}'
EOF
