From 746b1b28ee5f1d6e045b7a0d8849520d83f14893 Mon Sep 17 00:00:00 2001 From: Tyler Matijevich Date: Wed, 28 Jun 2023 22:20:59 -0500 Subject: [PATCH] Limit version string, adjust uncommitted changes warning message and flag --- BuildVersion.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BuildVersion.ps1 b/BuildVersion.ps1 index c82835a..9b1891c 100644 --- a/BuildVersion.ps1 +++ b/BuildVersion.ps1 @@ -199,6 +199,7 @@ catch { } $Tag = TruncateString $Tag 80 $Describe = TruncateString $Describe 80 +$Version = TruncateString $Version 80 # Sha1 # References: @@ -216,7 +217,6 @@ catch { $Sha1 = TruncateString $Sha1 80 # Uncommitted changes -$ChangeWarning = 1 try { $UncommittedChanges = git -C $args[0] diff --shortstat 2> $Null if($LASTEXITCODE -ne 0) { @@ -227,9 +227,10 @@ try { $UncommittedChanges = "None" $ChangeWarning = 0 } - elseif($OptionErrorOnUncommittedChanges) { + else { Write-Warning "BuildVersion: Uncommitted changes detected" - exit 1 + if($OptionErrorOnUncommittedChanges) { exit 1 } + $ChangeWarning = 1 } } catch {