last element of tags output can be empty
This commit is contained in:
@@ -84,8 +84,9 @@ if env['debug']:
|
|||||||
# This command generates the header with git revision information
|
# This command generates the header with git revision information
|
||||||
# NOTE: Changes made here must also be made in pkg/gitrev.sh!
|
# NOTE: Changes made here must also be made in pkg/gitrev.sh!
|
||||||
def gen_gitrev(env, target, source):
|
def gen_gitrev(env, target, source):
|
||||||
revid = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True);
|
revid = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True)
|
||||||
fulltag = subprocess.check_output(["git", "tag", "--sort=v:refname"], text=True).split('\n')[-1]
|
tag_array = subprocess.check_output(["git", "tag", "--sort=v:refname"], text=True).split('\n')
|
||||||
|
fulltag = list(filter(None, tag_array))[-1]
|
||||||
tagrev = subprocess.check_output(["git", "rev-parse", fulltag], text=True) if fulltag else ""
|
tagrev = subprocess.check_output(["git", "rev-parse", fulltag], text=True) if fulltag else ""
|
||||||
status = "clean"
|
status = "clean"
|
||||||
if subprocess.call(["git", "diff-index", "--quiet", "HEAD", "--"]) != 0:
|
if subprocess.call(["git", "diff-index", "--quiet", "HEAD", "--"]) != 0:
|
||||||
|
Reference in New Issue
Block a user