Skip to content

Commit 8fa5067

Browse files
committed
small build fix
1 parent 0aa0410 commit 8fa5067

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

scripts/build_release.ps1

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/switchcraft/gui_modern/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ def setup_banner(self):
10041004
bg_color = "RED" if is_dev else "AMBER"
10051005
text_color = "WHITE" if is_dev else "BLACK"
10061006

1007-
self.banner_container = ft.Container(
1007+
self.dev_banner_container = ft.Container(
10081008
content=ft.Text(text, color=text_color, weight="bold", text_align="center"),
10091009
bgcolor=bg_color,
10101010
padding=5,
@@ -1134,6 +1134,8 @@ def build_ui(self):
11341134
self.main_layout_wrapper = ft.Column(
11351135
controls=[
11361136
self.global_progress,
1137+
self.banner_container,
1138+
self.dev_banner_container,
11371139
self.content
11381140
],
11391141
expand=True,

0 commit comments

Comments
 (0)