mirror of
https://github.com/zealdocs/zeal.git
synced 2026-08-29 08:34:50 +08:00
build(chocolatey): fix missing bom
This commit is contained in:
@@ -67,10 +67,11 @@ if ($Version) {
|
||||
|
||||
foreach ($file in $files) {
|
||||
$path = Join-Path $root $file
|
||||
$encoding = if ($path -like '*.ps1') { 'utf8BOM' } else { 'utf8NoBOM' }
|
||||
$content = Get-Content $path -Raw
|
||||
$content = $content -replace '\d+\.\d+\.\d+', $Version
|
||||
$content = $content -replace $copyrightPattern, $copyrightReplace
|
||||
Set-Content $path $content -NoNewline
|
||||
Set-Content $path $content -NoNewline -Encoding $encoding
|
||||
Write-Information "Updated $file"
|
||||
}
|
||||
|
||||
@@ -78,14 +79,14 @@ if ($Version) {
|
||||
$content = Get-Content $path -Raw
|
||||
if ($content -notmatch '(?<=Checksum64\s+=\s+'')[a-f0-9]{64}') { throw "Checksum pattern not found in $path" }
|
||||
$content = $content -replace '(?<=Checksum64\s+=\s+'')[a-f0-9]{64}', $msiChecksum
|
||||
Set-Content $path $content -NoNewline
|
||||
Set-Content $path $content -NoNewline -Encoding utf8BOM
|
||||
Write-Information "Updated MSI checksum"
|
||||
|
||||
$path = Join-Path $root 'zeal.portable\tools\chocolateyinstall.ps1'
|
||||
$content = Get-Content $path -Raw
|
||||
if ($content -notmatch '(?<=Checksum64\s+=\s+'')[a-f0-9]{64}') { throw "Checksum pattern not found in $path" }
|
||||
$content = $content -replace '(?<=Checksum64\s+=\s+'')[a-f0-9]{64}', $portableChecksum
|
||||
Set-Content $path $content -NoNewline
|
||||
Set-Content $path $content -NoNewline -Encoding utf8BOM
|
||||
Write-Information "Updated portable checksum"
|
||||
|
||||
Write-Information "`nDone. Updated to v$Version."
|
||||
|
||||
Reference in New Issue
Block a user