xwords/xwords4/scripts/gitversion.sh
2010-06-05 07:20:49 -07:00

17 lines
244 B
Bash
Executable file

#!/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