Utopia-Canteen-System/scripts/publish-backend-selfcontain...

20 lines
574 B
PowerShell

$ErrorActionPreference = "Stop"
$ProjectPath = ".\UtopiaCanteen.BackendService\UtopiaCanteen.BackendService.csproj"
$OutputPath = "C:\Users\Public\UtopiaCanteenBackend"
Write-Host "Cleaning old backend publish folder..."
if (Test-Path $OutputPath) {
Remove-Item $OutputPath -Recurse -Force
}
Write-Host "Publishing backend as self-contained..."
dotnet publish $ProjectPath `
-c Release `
-r win-x64 `
--self-contained true `
-p:PublishSingleFile=false `
-o $OutputPath
Write-Host "Backend self-contained publish completed:"
Write-Host $OutputPath