Remove test code, add git commit to version flag

This commit is contained in:
Bilal Elmoussaoui 2016-12-13 00:35:31 +01:00
parent a8de58e629
commit ccaefc30ad
2 changed files with 7 additions and 7 deletions

View file

@ -38,12 +38,10 @@ if __name__ == "__main__":
locale.textdomain('gnome-twofactorauth')
gettext.bindtextdomain('gnome-twofactorauth', '@LOCALE_DIR@')
gettext.textdomain('gnome-twofactorauth')
version = "@GITVERSION@"
if not version:
version = "@VERSION@"
GIT_VERSION = "@GITVERSION@"
VERSION = "@VERSION@"
env["DATA_DIR"] = "@DATADIR@"
env["LOCALE_DIR"] = '@LOCALE_DIR@'
print("@LOCALE_DIR@")
parser = argparse.ArgumentParser(prog="Gnome-TwoFactorAuth")
parser.add_argument("--debug", "-d", action="store_true",
@ -66,7 +64,9 @@ if __name__ == "__main__":
'gnome-twofactorauth.gresource'))
Gio.Resource._register(resource)
if args.version:
sys.exit("Version : " + str(version))
if GIT_VERSION:
print("Git current commit : " + str(GIT_VERSION))
sys.exit("Version : " + str(VERSION))
elif args.about:
about_dialog = application.Application.about_dialog()
about_dialog.run()

View file

@ -6,8 +6,8 @@ project('gnome-twofactorauth', 'c',
python = find_program('python3')
git = find_program('git', required : false)
intltool_merge = find_program('intltool-merge')
if git.found()
GITVERSION = run_command(git, 'describe', '--always').stdout().strip()
if git.found()
GITVERSION = run_command(git, 'rev-parse', 'HEAD').stdout().strip()
else
GITVERSION = ''
endif