fix(scripts): write package manifest without utf-8 bom

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michael SloanandCursor committed 2026-08-02 16:31:46 -04:00
1 parent 6ba5e34d4b
commit 8640d12ac1
1 file changed
+4 -3
+4 -3
View File
@@ -44,8 +44,9 @@ $meta = [ordered]@{
framework = "net9.0" framework = "net9.0"
timestamp = $timestamp timestamp = $timestamp
} }
$utf8NoBom = New-Object System.Text.UTF8Encoding $false
$metaJson = $meta | ConvertTo-Json -Depth 5 $metaJson = $meta | ConvertTo-Json -Depth 5
[System.IO.File]::WriteAllText((Join-Path $stageDir "meta.json"), $metaJson) [System.IO.File]::WriteAllText((Join-Path $stageDir "meta.json"), $metaJson, $utf8NoBom)
Copy-Item $dllPath -Destination (Join-Path $stageDir "Jellyfin.Plugin.Request.dll") Copy-Item $dllPath -Destination (Join-Path $stageDir "Jellyfin.Plugin.Request.dll")
$tempZip = Join-Path $releaseDir ("tmp_" + [guid]::NewGuid().ToString("N") + ".zip") $tempZip = Join-Path $releaseDir ("tmp_" + [guid]::NewGuid().ToString("N") + ".zip")
@@ -81,10 +82,10 @@ $plugin = [ordered]@{
versions = @($versionObj) versions = @($versionObj)
} }
# Jellyfin requires a JSON array root. # Jellyfin requires a JSON array root and no UTF-8 BOM.
$pluginJson = ($plugin | ConvertTo-Json -Depth 8) $pluginJson = ($plugin | ConvertTo-Json -Depth 8)
$manifestJson = "[" + [Environment]::NewLine + $pluginJson + [Environment]::NewLine + "]" $manifestJson = "[" + [Environment]::NewLine + $pluginJson + [Environment]::NewLine + "]"
[System.IO.File]::WriteAllText($manifestPath, $manifestJson) [System.IO.File]::WriteAllText($manifestPath, $manifestJson, $utf8NoBom)
Write-Host "Packaged: $zipPath" Write-Host "Packaged: $zipPath"
Write-Host "Checksum: $checksum" Write-Host "Checksum: $checksum"