feat: Enhance update manager to handle UTF-8 BOM and improve asset resolution logic

This commit is contained in:
claudi 2026-03-12 11:00:43 +01:00
parent 44124595d8
commit 093b196d0d
4 changed files with 46 additions and 2 deletions

View file

@ -80,7 +80,8 @@ if ($artifactPaths.Count -eq 0) {
exit 1
}
$localData.manifest | ConvertTo-Json -Depth 10 | Set-Content -Path $localManifestPath -Encoding utf8
$localManifestJson = $localData.manifest | ConvertTo-Json -Depth 10
[System.IO.File]::WriteAllText($localManifestPath, $localManifestJson, (New-Object System.Text.UTF8Encoding($false)))
if ($DryRun) {
Copy-Item $localManifestPath $manifestOutput -Force
@ -155,6 +156,12 @@ else {
Copy-Item $localManifestPath $manifestOutput -Force
}
# Ensure uploaded manifest is UTF-8 without BOM (for strict JSON parsers)
if (Test-Path $manifestOutput) {
$manifestText = Get-Content -Raw -Path $manifestOutput
[System.IO.File]::WriteAllText($manifestOutput, $manifestText, (New-Object System.Text.UTF8Encoding($false)))
}
$artifactPaths.Add($manifestOutput)
$assetMap = Get-AssetMap -Assets $releaseInfo.assets