SDT/scripts/legacy/nuget-import-cache.legacy.ps1
2026-03-01 20:52:56 -06:00

26 lines
973 B
PowerShell

param(
[string]$InputZip = "nuget-cache-export.zip"
)
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
$inputPath = if ([System.IO.Path]::IsPathRooted($InputZip)) { $InputZip } else { Join-Path $repoRoot $InputZip }
if (-not (Test-Path $inputPath)) {
Write-Error "Input zip not found: $inputPath"
exit 1
}
Write-Host "Importing cache from: $inputPath"
Expand-Archive -Path $inputPath -DestinationPath $repoRoot -Force
Write-Host "Running restore with local cache..."
& (Join-Path $PSScriptRoot "dotnet-min.ps1") restore "Journal.Sidecar/Journal.Sidecar.csproj"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& (Join-Path $PSScriptRoot "dotnet-min.ps1") restore "Journal.WebGateway/Journal.WebGateway.csproj"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& (Join-Path $PSScriptRoot "dotnet-min.ps1") restore "Journal.SmokeTests/Journal.SmokeTests.csproj"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "Cache import complete."