]> git.ipfire.org Git - thirdparty/suricata-update.git/commitdiff
setup: don't try to write revision of .git doesn't exist 18/head
authorJason Ish <ish@unx.ca>
Fri, 8 Dec 2017 13:08:48 +0000 (07:08 -0600)
committerJason Ish <ish@unx.ca>
Fri, 8 Dec 2017 13:22:31 +0000 (07:22 -0600)
setup.py

index 99dec9a6dbdf982be207cc63a03eaafae1f9079f..a7af0cae5a56b222d95efce28f31781cf7608737 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,12 @@
+import os.path
 import subprocess
 from setuptools import setup
 
 from suricata.update.version import version
 
-def write_revision():
+def write_git_revision():
+    if not os.path.exists(".git"):
+        return
     try:
         revision = subprocess.check_output(
             ["git", "rev-parse", "--short", "HEAD"])
@@ -12,7 +15,7 @@ def write_revision():
     except Exception as err:
         print("Failed to get current git revision: %s" % (err))
 
-write_revision()
+write_git_revision()
 
 setup(
     name="suricata-update",