mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-12-16 02:45:48 -07:00
Addressed Staging Freshness Testing & Fixed Page Title, Subtitle, and Icon Missing Issues
This commit is contained in:
45
Borealis.ps1
45
Borealis.ps1
@@ -270,6 +270,41 @@ function Ensure-EngineWebInterface {
|
||||
}
|
||||
}
|
||||
|
||||
function Get-WebUiLatestWriteTime {
|
||||
param([string]$Root)
|
||||
|
||||
if (-not (Test-Path $Root)) { return $null }
|
||||
|
||||
$exclusions = @('\node_modules\', '\build\', '\dist\')
|
||||
$files = Get-ChildItem -Path $Root -Recurse -File -ErrorAction SilentlyContinue | Where-Object {
|
||||
$full = $_.FullName
|
||||
-not ($exclusions | Where-Object { $full -like "*$_*" })
|
||||
}
|
||||
if (-not $files) { return $null }
|
||||
return ($files | Sort-Object -Property LastWriteTime -Descending | Select-Object -First 1).LastWriteTime
|
||||
}
|
||||
|
||||
function Test-WebUiBuildFresh {
|
||||
param(
|
||||
[string]$SourceRoot,
|
||||
[string]$BuildRoot
|
||||
)
|
||||
|
||||
$sourceLatest = Get-WebUiLatestWriteTime -Root $SourceRoot
|
||||
if (-not $sourceLatest) { return $false }
|
||||
|
||||
$buildIndex = Join-Path $BuildRoot 'index.html'
|
||||
if (-not (Test-Path $buildIndex -PathType Leaf)) { return $false }
|
||||
|
||||
try {
|
||||
$buildTime = (Get-Item $buildIndex -ErrorAction Stop).LastWriteTime
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
|
||||
return ($buildTime -ge $sourceLatest)
|
||||
}
|
||||
|
||||
$script:Utf8CodePageChanged = $false
|
||||
|
||||
function Ensure-SystemUtf8CodePage {
|
||||
@@ -1184,6 +1219,16 @@ switch ($choice) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($engineImmediateLaunch) {
|
||||
$webUiSourceRoot = Join-Path $scriptDir 'Data\Engine\web-interface'
|
||||
$webUiBuildRoot = Join-Path $scriptDir 'Engine\web-interface\build'
|
||||
$webUiFresh = Test-WebUiBuildFresh -SourceRoot $webUiSourceRoot -BuildRoot $webUiBuildRoot
|
||||
if (-not $webUiFresh) {
|
||||
Write-Host "Detected WebUI changes newer than the last production build. Running full build instead of Quick/Skip." -ForegroundColor Yellow
|
||||
$engineImmediateLaunch = $false
|
||||
}
|
||||
}
|
||||
|
||||
if ($engineModeChoice -notin @('1','2','3')) {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user