mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
Updated getrevision.sh script
- it can now show long/short revision number
This commit is contained in:
parent
0c4b8e164e
commit
ed74c773b3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user