summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
Diffstat (limited to 'wscript')
-rw-r--r--wscript12
1 files changed, 8 insertions, 4 deletions
diff --git a/wscript b/wscript
index e177d91f..d8113ccd 100644
--- a/wscript
+++ b/wscript
@@ -1,4 +1,5 @@
import subprocess
+import os
APPNAME = 'libdcp'
VERSION = '0.04pre'
@@ -43,10 +44,13 @@ def dist(ctx):
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'