aboutsummaryrefslogtreecommitdiff
path: root/utils.sh
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-12-21 09:22:05 +0200
committerRiccardo Spagni <ric@spagni.net>2016-12-21 09:22:05 +0200
commit40922305daba145e485b5123834e6ddd5c48ccfd (patch)
treeeef2c9690b3c3b9685b15f29d253817fec1e9e27 /utils.sh
parent4713228d96c5216e703b2b79e3724f645d5c6ad0 (diff)
parentf19318fbd13984af19cd062caccc71dec090272c (diff)
downloadmonzero-gui-40922305daba145e485b5123834e6ddd5c48ccfd.tar.gz
monzero-gui-40922305daba145e485b5123834e6ddd5c48ccfd.tar.xz
monzero-gui-40922305daba145e485b5123834e6ddd5c48ccfd.zip
Merge pull request #314
f19318f Add git version to the settings page (moneromooo.monero)
Diffstat (limited to 'utils.sh')
-rwxr-xr-xutils.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/utils.sh b/utils.sh
index f04a485c..27304a7d 100755
--- a/utils.sh
+++ b/utils.sh
@@ -21,6 +21,33 @@ function get_platform {
}
+function get_tag()
+{
+ COMMIT=$(git rev-parse --short HEAD | sed -e 's/[\t ]*//')
+ if test $? -ne 0
+ then
+ echo "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive."
+ VERSIONTAG="unknown"
+ else
+ echo "You are currently on commit ${COMMIT}"
+ TAGGEDCOMMIT=$(git rev-list --tags --max-count=1 --abbrev-commit | sed -e 's/[\t ]*//')
+ if test -z "$TAGGEDCOMMIT"
+ then
+ echo "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive."
+ VERSIONTAG=$COMMIT
+ else
+ echo "The most recent tag was at ${TAGGEDCOMMIT}"
+ if test "$TAGGEDCOMMIT" = "$COMMIT"
+ then
+ echo "You are building a tagged release"
+ VERSIONTAG="release"
+ else
+ echo "You are ahead of or behind a tagged release"
+ VERSIONTAG="$COMMIT"
+ fi
+ fi
+ fi
+}