1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Updated getrevision.sh script

- it can now show long/short revision number
This commit is contained in:
nowrep 2012-11-09 15:43:52 +01:00
parent 0c4b8e164e
commit ed74c773b3

View File

@ -1,10 +1,21 @@
#!/bin/bash
#git show-ref refs/heads/master | cut -d " " -f 1 | cut -c 1-10
if [ -e "/usr/bin/git" ] && [ -e ".git" ]; then
git show-ref refs/heads/master | cut -d " " -f 1 | cut -c 1-10;
REV=""
if [ -e "/usr/bin/git" ] && ([ -e ".git" ] || [ -e "../.git" ]); then
REV=`git show-ref refs/heads/master | cut -d " " -f 1`
elif [ -e "git_revision" ]; then
cat git_revision | cut -c 1-10;
REV=`cat git_revision`
fi
case $1 in
long)
echo $REV
;;
short|*)
echo $REV | cut -c 1-10
;;
esac
exit;