@@ -231,21 +231,19 @@ if (-not $IsCI -and (Test-Path (Join-Path $RepoRoot ".git"))) {
231231 if ($GitCommit ) {
232232 # Append local dev suffix only if not already present
233233 if (-not ($AppVersion -like " *$GitCommit *" )) {
234- # If version is already a dev version (has .dev), just append +commit if missing?
235- # Or typically we want "X.Y.Z.dev0+commit"
236- # If AppVersion is "2026.1.5", we make "2026.1.5.dev0+commit"
237- # If AppVersion is "2026.1.5.dev0+oldcommit", we might be in trouble, but assuming standard flow:
238-
239- if ($AppVersion -match " dev\d+" ) {
240- # Already has dev tag, maybe just missing commit or has different one?
241- # Ideally we replace the existing build metadata?
242- # For safety/simplicity in this script: Don't append .dev0 again if it has dev match
243- $AppVersion = " $AppVersion +$GitCommit "
234+ # Check if the version already contains a commit hash or complex metadata (+)
235+ if ($AppVersion -match " \+" ) {
236+ Write-Host " Local Dev Build: Version already contains build metadata/hash ($AppVersion ). Skipping second append." - ForegroundColor Gray
244237 } else {
245- $AppVersion = " $AppVersion .dev0+$GitCommit "
238+ if ($AppVersion -match " dev\d+" ) {
239+ # Already has dev tag, but missing commit
240+ $AppVersion = " $AppVersion +$GitCommit "
241+ } else {
242+ $AppVersion = " $AppVersion .dev0+$GitCommit "
243+ }
244+ Write-Host " Local Dev Build Detected: Appending commit hash $GitCommit " - ForegroundColor Cyan
245+ Write-Host " New Version: $AppVersion " - ForegroundColor Cyan
246246 }
247- Write-Host " Local Dev Build Detected: Appending commit hash $GitCommit " - ForegroundColor Cyan
248- Write-Host " New Version: $AppVersion " - ForegroundColor Cyan
249247 } else {
250248 Write-Host " Local Dev Build: Version already contains current commit hash ($GitCommit ). Skipping append." - ForegroundColor Gray
251249 }
0 commit comments