Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 574cb2e

Browse files
committed
Add build_info functionality
1 parent 6def17d commit 574cb2e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

runestone/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ def build(options):
4848

4949
try:
5050
bi = sh('git describe --long',capture=True)[:-1]
51-
bi = bi.split('-')[0]
52-
options.build.template_args["build_info"] = bi
51+
bnum = bi.split('-')[0]
52+
options.build.template_args["build_info"] = bnum
5353
except:
54+
bi = "unknown-0-0"
5455
options.build.template_args["build_info"] = 'unknown'
5556

57+
with open('build_info','w') as bif:
58+
bif.write(bi)
59+
bif.write("\n")
60+
5661
if 'outputdir' in options.build:
5762
options.build.outdir = options.build.outputdir
5863

0 commit comments

Comments
 (0)