import subprocess
+import os
APPNAME = 'libdcp'
VERSION = '0.04pre'
ctx.excl = 'TODO core *~ .git build .waf* .lock* doc/*~ src/*~ test/ref/*~'
def create_version_cc(version):
- cmd = "LANG= git log --abbrev HEAD^..HEAD ."
- output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
- o = output[0].decode('utf-8')
- commit = o.replace ("commit ", "")[0:10]
+ if os.path.exists('.git'):
+ cmd = "LANG= git log --abbrev HEAD^..HEAD ."
+ output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
+ o = output[0].decode('utf-8')
+ commit = o.replace ("commit ", "")[0:10]
+ else:
+ commit = "release"
try:
text = '#include "version.h"\n'