From 2a52340a9d8d3842a737d04a01a968f79b5a4707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20De=C3=A1k?= Date: Fri, 4 Jun 2021 16:30:10 +1000 Subject: [PATCH] Tweaked version extraction from tags. --- Scripts/Detail/Config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/Detail/Config.py b/Scripts/Detail/Config.py index f5c658e..d0e5057 100644 --- a/Scripts/Detail/Config.py +++ b/Scripts/Detail/Config.py @@ -151,15 +151,17 @@ class Configuration(): lastTag = utility.captureCommandOutput( "git describe --tags --abbrev=0" ) - matches = re.search( "v?(\d+(?:\.\d+)+)-(\w+)", lastTag ) + utility.printItem( "lastTag: ", lastTag ) + + matches = re.search( "v?(\d+(?:\.\d+)+)(?:-(\w+))?", lastTag ) if not matches: utility.printError( "Unable to extract version information from Git tags." ) raise SystemExit( 1 ) self.productVersion = matches.group( 1 ) - self.productStage = matches.group( 2 ) self.productRevision = utility.captureCommandOutput( "git rev-parse --short=8 HEAD" ) + self.productStage = matches.group( 2 ) if matches.group( 2 ) else self.productRevision self.productPackageName = "-".join( [ self.productName, self.productVersion, self.productStage, self.platformVersion ] ).lower() utility.printItem( "productVersion: ", self.productVersion )