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.
|
#!/bin/bash |
|
|
|
REV="" |
|
|
|
if [ -e "/usr/bin/git" ] && ([ -e ".git" ] || [ -e "../.git" ]); then |
|
REV=`git rev-parse HEAD` |
|
elif [ -e "git_revision" ]; then |
|
REV=`cat git_revision` |
|
fi |
|
|
|
case $1 in |
|
long) |
|
echo $REV |
|
;; |
|
|
|
short|*) |
|
echo $REV | cut -c 1-10 |
|
;; |
|
esac |
|
|
|
exit 0
|
|
|