allow no tags

This commit is contained in:
2024-09-13 18:49:14 -05:00
committed by Celtic Minstrel
parent 640492a428
commit 66aeb48a37

View File

@@ -86,7 +86,10 @@ if env['debug']:
def gen_gitrev(env, target, source):
revid = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True)
tag_array = subprocess.check_output(["git", "tag", "--sort=v:refname"], text=True).split('\n')
fulltag = list(filter(None, tag_array))[-1]
tag_array = list(filter(None, tag_array))
fulltag = ""
if len(tag_array) > 0:
fulltag = tag_array[-1]
tagrev = subprocess.check_output(["git", "rev-parse", fulltag], text=True) if fulltag else ""
status = "clean"
if subprocess.call(["git", "diff-index", "--quiet", "HEAD", "--"]) != 0: