feat(app): stats added in to check if build in last build and also if theres a pending file

This commit is contained in:
2025-09-26 10:44:41 -05:00
parent 86dea6083e
commit 58aedecd4d
25 changed files with 2113 additions and 42 deletions

View File

@@ -186,6 +186,43 @@ function Update-Server {
Write-Output "[$key] already exists -> skipping"
}
}
# update the controller .env as well to make sure we have anything enw in here.
$requiredController = @(
@{ Key = "DATABASE_HOST"; Value = "localhost"; Comment = "used for better auth secrets" },
@{ Key = "DATABASE_PORT"; Value = 5432; Comment = "The better auth url" }
@{ Key = "DATABASE_USER"; Value = "postgres"; Comment = "" }
@{ Key = "DATABASE_PASSWORD"; Value = "obelix"; Comment = "" }
@{ Key = "DATABASE_DB"; Value = "lst$(if ($token -eq "usiow2") { "_2" })"; Comment = "" }
)
$envFileController = "$LocalPath\controller\.env"
Write-Host $envFileController
if (-not (Test-Path $envFileController)) {
New-Item -ItemType File -Path $envFileController -Force | Out-Null
}
$lines = Get-Content $envFileController
foreach ($item in $requiredController) {
$key = $item.Key
$value = $item.Value
$comment = "# $($item.Comment)"
$exists = $lines | Where-Object { $_ -match "^\s*$key\s*=" }
if (-not $exists) {
Write-Output "[$key] missing -> adding to .env"
Add-Content -Path $envFileController -Value "`n$comment"
Add-Content -Path $envFileController -Value "$key=$value"
}
else {
Write-Output "[$key] already exists -> skipping"
}
}
}