You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
301 B
10 lines
301 B
9 years ago
|
def git_version():
|
||
|
import subprocess
|
||
|
cmd = ['git', 'describe', '--always', '--match', 'v[0-9].*', '--dirty']
|
||
|
p = subprocess.Popen(cmd, stdout = subprocess.PIPE)
|
||
|
v = p.communicate()[0].strip()
|
||
|
r = p.returncode
|
||
|
if r != 0:
|
||
|
raise subprocess.CalledProcessError(r, ' '.join(cmd))
|
||
|
return v
|