blob: ff7ae5ecb440e51700543240273fb28e0fadb567 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/bin/bash
if [[ $(command -v git) = "" ]]; then
short_hash="FFFFFFFF"
else
if (git diff --quiet); then
#Clean
short_hash="0$(git rev-parse --verify HEAD --short)"
else
#Dirty
short_hash="F$(git rev-parse --verify HEAD --short)"
fi
fi
echo ${short_hash^^}
|