From 83dcb77425b25547e7c496384f80a0656e816b85 Mon Sep 17 00:00:00 2001 From: Shahovalov MIkhail Date: Wed, 8 Apr 2026 00:58:51 +0300 Subject: [PATCH] Stage package sources in temp directory --- scripts/build.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index f31cd8e..f0b3769 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -21,7 +21,8 @@ $workspacePath = [System.IO.Path]::GetFullPath($Workspace) $modsPath = Join-Path $workspacePath "Mods" $modPath = Join-Path $modsPath $ModFolder $buildPath = Join-Path $workspacePath "build" -$stagingPath = Join-Path $workspacePath "build-stage" +$stagingRoot = Join-Path $env:TEMP "bg3-dnd55e-russian-localization-stage" +$stagingPath = Join-Path $stagingRoot "build-stage" $packagePath = Join-Path $buildPath $PackageName $tempPackagePath = Join-Path $env:TEMP $PackageName $archiveName = $ArchiveBaseName @@ -59,9 +60,16 @@ foreach ($path in @($stagingPath, $tempPackagePath, $packagePath, $zipPath, $inf } } -New-Item -ItemType Directory -Path $stagingPath | Out-Null +if (Test-Path -LiteralPath $stagingRoot) { + Remove-Item -LiteralPath $stagingRoot -Recurse -Force +} + +New-Item -ItemType Directory -Path $stagingPath -Force | Out-Null Copy-Item -LiteralPath $modsPath -Destination $stagingPath -Recurse +Write-Host "[build.ps1] Staged source tree:" +Get-ChildItem -Recurse $stagingPath | Select-Object FullName, Length | Format-Table -AutoSize + if (Test-Path -LiteralPath $tempPackagePath) { Remove-Item -LiteralPath $tempPackagePath -Force }