Files
LanMountainDesktop/scripts/Sign-FileMap.ps1

27 lines
752 B
PowerShell
Raw Permalink Normal View History

param(
[Parameter(Mandatory = $true)]
2026-04-16 01:59:21 +08:00
[string]$FilesJsonPath,
[Parameter(Mandatory = $true)]
2026-04-16 01:59:21 +08:00
[string]$PrivateKeyPath,
[Parameter(Mandatory = $false)]
2026-04-16 01:59:21 +08:00
[string]$OutputPath
)
$ErrorActionPreference = "Stop"
if ([string]::IsNullOrWhiteSpace($OutputPath)) {
$OutputPath = "$FilesJsonPath.sig"
}
$toolProject = Join-Path $PSScriptRoot "..\PenguinLogisticsOnlineNetworkDistributionSystem\src\Plonds.Tool\Plonds.Tool.csproj"
if (-not (Test-Path -LiteralPath $toolProject)) {
throw "PLONDS tool project not found: $toolProject"
}
2026-04-16 01:59:21 +08:00
& dotnet run --project $toolProject -- sign --manifest $FilesJsonPath --private-key $PrivateKeyPath --output $OutputPath
if ($LASTEXITCODE -ne 0) {
throw "PLONDS sign command failed."
}