xwords/xwords4/scripts/gitversion.sh

18 lines
244 B
Bash
Raw Normal View History

#!/bin/sh
usage() {
echo "usage: $0"
exit 1
}
[ -z "$1" ] || usage
HASH=$(git log -1 --pretty=format:%H)
# mark it with a "+" if anything's changed
if git status --porcelain | grep -q '^[^\?]'; then
HASH="${HASH}+M"
fi
echo $HASH