diff options
| author | moneromooo.monero <moneromooo.monero@users.noreply.github.com> | 2016-12-20 21:13:42 +0000 |
|---|---|---|
| committer | moneromooo.monero <moneromooo.monero@users.noreply.github.com> | 2016-12-20 21:13:42 +0000 |
| commit | f19318fbd13984af19cd062caccc71dec090272c (patch) | |
| tree | 7bafb4336794441c64cdfe18ecd6bc108bfd7c26 /utils.sh | |
| parent | aea9c233ccfd7e05da17904b955ab7dfc2c69142 (diff) | |
| download | monzero-gui-f19318fbd13984af19cd062caccc71dec090272c.tar.gz monzero-gui-f19318fbd13984af19cd062caccc71dec090272c.tar.xz monzero-gui-f19318fbd13984af19cd062caccc71dec090272c.zip | |
Add git version to the settings page
Useful for bug reports
Diffstat (limited to 'utils.sh')
| -rwxr-xr-x | utils.sh | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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 +} |
