From b66c39724c42b9e63891d06a41fb4a87c8c3f6c7 Mon Sep 17 00:00:00 2001 From: QiuSW <105186638@qq.com> Date: Sun, 16 Aug 2026 19:18:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E6=A8=A1=E5=9D=97=E4=BE=9D=E8=B5=96=20(#70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sense/scripts/build/build-windows.ps1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Sense/scripts/build/build-windows.ps1 b/Sense/scripts/build/build-windows.ps1 index b084199..a08194f 100644 --- a/Sense/scripts/build/build-windows.ps1 +++ b/Sense/scripts/build/build-windows.ps1 @@ -18,6 +18,17 @@ function Assert-ChildPath([string]$Parent, [string]$Child) { } } +function Get-SenseFileSha256([string]$Path) { + $sha256 = [Security.Cryptography.SHA256]::Create() + $stream = [IO.File]::OpenRead($Path) + try { + return ([BitConverter]::ToString($sha256.ComputeHash($stream))).Replace('-', '') + } finally { + $stream.Dispose() + $sha256.Dispose() + } +} + Assert-ChildPath $senseRoot $distRoot Assert-ChildPath $distRoot $target Assert-ChildPath $distRoot $archive @@ -89,7 +100,7 @@ try { if ($LASTEXITCODE -ne 0) { throw 'Sense package audit failed.' } $manifest = foreach ($file in Get-ChildItem -LiteralPath $staging -Recurse -File | Sort-Object FullName) { $relative = $file.FullName.Substring($staging.Length + 1).Replace('\', '/') - "$(Get-FileHash -LiteralPath $file.FullName -Algorithm SHA256 | Select-Object -ExpandProperty Hash) $relative" + "$(Get-SenseFileSha256 -Path $file.FullName) $relative" } [IO.File]::WriteAllLines((Join-Path $staging 'MANIFEST.sha256'), $manifest, (New-Object Text.UTF8Encoding($false)))