geary/build-aux/git_version.py
Michael James Gratton eebe498a3e Add missing build aux file for obtaining the git version.
This is needed to make commit e8e7139 work for people that are not me.
2018-01-26 14:41:46 +10:30

16 lines
326 B
Python
Executable file

#!/usr/bin/env python3
import re
import sys
import subprocess
try:
version = subprocess.check_output(
['git', 'describe', '--all', '--long', '--dirty'],
stderr=subprocess.DEVNULL
)
except:
sys.exit(1)
version = str(version, encoding='UTF-8').strip()
print(re.sub(r'^heads\/(.*)-0-(g.*)$', r'\1~\2', version))