You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
593 B
22 lines
593 B
#!/bin/sh
|
|
|
|
if [ -f ${1}/.version ]; then
|
|
cat ${1}/.version
|
|
elif [ -d ${1}/.git ]; then
|
|
VERSION=`git describe --tags --dirty=M 2> /dev/null | sed -e "s/^v\([0-9]\)/\1/"`
|
|
if [ $? -ne 0 ]; then
|
|
MODIFIED=""
|
|
if [ "`git ls-files -m | wc -l`" != "0" ]; then
|
|
MODIFIED="M"
|
|
fi
|
|
# Some older versions of git do not support all the above
|
|
# options.
|
|
VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED}
|
|
fi
|
|
echo ${VERSION}
|
|
else
|
|
# Use the directory information in the absence of any other version
|
|
# information
|
|
pwd -P
|
|
fi
|