Skip to content

Commit 09bff90

Browse files
dvjhenryiii
authored andcommitted
Allow MakeSingleHeader.py script to run from non-git source code (ie: an archive)
1 parent 4e62a0a commit 09bff90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/MakeSingleHeader.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import os
88
import re
99
import argparse
10-
from subprocess import check_output
10+
from subprocess import check_output, CalledProcessError
1111

1212
includes_local = re.compile(r"""^#include "(.*)"$""", re.MULTILINE)
1313
includes_system = re.compile(r"""^#include \<(.*)\>$""", re.MULTILINE)
@@ -17,7 +17,10 @@
1717

1818
print("Git directory:", DIR)
1919

20-
TAG = check_output(['git', 'describe', '--tags', '--always'], cwd=str(DIR)).decode("utf-8")
20+
try:
21+
TAG = check_output(['git', 'describe', '--tags', '--always'], cwd=str(DIR)).decode("utf-8")
22+
except CalledProcessError:
23+
TAG = "A non-git source"
2124

2225
def MakeHeader(out):
2326
main_header = os.path.join(BDIR, 'CLI', 'CLI.hpp')

0 commit comments

Comments
 (0)