49 lines
1.3 KiB
PowerShell
49 lines
1.3 KiB
PowerShell
param(
|
|
[ValidateSet("Release", "Debug")]
|
|
[string]$Configuration = "Release",
|
|
[string]$Urls = "http://0.0.0.0:5180",
|
|
[string]$ProjectRoot
|
|
)
|
|
|
|
$commonScript = Join-Path $PSScriptRoot "script-common.ps1"
|
|
if (-not (Test-Path $commonScript)) {
|
|
throw "Missing helper script: $commonScript"
|
|
}
|
|
. $commonScript
|
|
|
|
$repoRoot = Resolve-JournalRepoRoot -StartPath $PSScriptRoot
|
|
$gatewayProject = Resolve-JournalWebGatewayProjectPath -RepoRoot $repoRoot
|
|
|
|
$effectiveProjectRoot = if ([string]::IsNullOrWhiteSpace($ProjectRoot)) {
|
|
$repoRoot
|
|
}
|
|
else {
|
|
[System.IO.Path]::GetFullPath($ProjectRoot)
|
|
}
|
|
|
|
if (-not (Test-Path $effectiveProjectRoot)) {
|
|
throw "ProjectRoot does not exist: $effectiveProjectRoot"
|
|
}
|
|
|
|
Clear-JournalProxyEnv
|
|
Initialize-JournalDotnetEnv -RepoRoot $repoRoot
|
|
$env:JOURNAL_PROJECT_ROOT = $effectiveProjectRoot
|
|
|
|
Write-Host "Running Journal.WebGateway ($Configuration)..." -ForegroundColor Cyan
|
|
Write-Host "Project: $gatewayProject" -ForegroundColor DarkGray
|
|
Write-Host "URLs: $Urls" -ForegroundColor DarkGray
|
|
Write-Host "JOURNAL_PROJECT_ROOT: $effectiveProjectRoot" -ForegroundColor DarkGray
|
|
|
|
$runArgs = @(
|
|
"run",
|
|
"--project", $gatewayProject,
|
|
"-c", $Configuration,
|
|
"--no-launch-profile",
|
|
"--urls", $Urls,
|
|
"-p:RestoreIgnoreFailedSources=true",
|
|
"-p:NuGetAudit=false"
|
|
)
|
|
|
|
& dotnet @runArgs
|
|
exit $LASTEXITCODE
|