Skip to content

Commit

Permalink
Limit version string, adjust uncommitted changes warning message and …
Browse files Browse the repository at this point in the history
…flag
  • Loading branch information
tmatijevich committed Jun 29, 2023
1 parent dbe29a7 commit 746b1b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions BuildVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ catch {
}
$Tag = TruncateString $Tag 80
$Describe = TruncateString $Describe 80
$Version = TruncateString $Version 80

# Sha1
# References:
Expand All @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 746b1b2

Please sign in to comment.