~dani.behzi/saghar/trunk

« back to all changes in this revision

Viewing changes to scripts/getrevision.sh

  • Committer: Danial Behzadi
  • Date: 2015-02-05 21:45:44 UTC
  • Revision ID: dani.behzi@gmail.com-20150205214544-6e80ydwmb9ekzwl6
UploadĀ Source

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
## copied from QupZilla project
 
3
 
 
4
REV=""
 
5
 
 
6
if [ -e "/usr/bin/git" ] && ([ -e ".git" ] || [ -e "../.git" ]); then
 
7
    REV=`git show-ref refs/heads/master | cut -d " " -f 1`
 
8
elif [ -e "git_revision" ]; then
 
9
    REV=`cat git_revision`
 
10
fi
 
11
 
 
12
case $1 in
 
13
    long)
 
14
        echo $REV
 
15
        ;;
 
16
 
 
17
    short|*)
 
18
        echo $REV | cut -c 1-10
 
19
        ;;
 
20
esac
 
21
 
 
22
exit 0