|
|
@@ -19,10 +19,23 @@ function Invoke-Checked($command, [string[]]$arguments) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-Write-Step "Workspace: $(Get-Location)"
|
|
|
+$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
|
+$platformRoot = Split-Path -Parent $scriptDir
|
|
|
+$repoRoot = Split-Path -Parent $platformRoot
|
|
|
+
|
|
|
+$webDir = Join-Path $repoRoot "Web"
|
|
|
+$entryDir = Join-Path $repoRoot "server/Admin.NET.Web.Entry"
|
|
|
+$coreCsproj = Join-Path $repoRoot "server/Admin.NET.Core/Admin.NET.Core.csproj"
|
|
|
+
|
|
|
+Write-Step "Repo root: $repoRoot"
|
|
|
+Write-Step "Current directory: $(Get-Location)"
|
|
|
+
|
|
|
+if (-not (Test-Path $webDir)) { throw "Web directory not found: $webDir (expected next to ai-dop-platform/)" }
|
|
|
+if (-not (Test-Path $entryDir)) { throw "Web.Entry directory not found: $entryDir" }
|
|
|
+if (-not (Test-Path $coreCsproj)) { throw "Core csproj not found: $coreCsproj" }
|
|
|
|
|
|
if (-not (Test-Command "dotnet")) {
|
|
|
- throw "dotnet not found. Please install .NET SDK 8.x first."
|
|
|
+ throw "dotnet not found. Please install .NET SDK 8.x (and 10.x if restore reports NETSDK1045)."
|
|
|
}
|
|
|
|
|
|
$dotnetVersion = (dotnet --version)
|
|
|
@@ -35,12 +48,6 @@ if (-not (Test-Command "node")) {
|
|
|
$nodeVersion = (node --version)
|
|
|
Write-Step "node version: $nodeVersion"
|
|
|
|
|
|
-$webDir = "d:/Projects/Ai-DOP/SourceCode/references/Admin.NET/Web"
|
|
|
-$entryDir = "d:/Projects/Ai-DOP/SourceCode/references/Admin.NET/server/Admin.NET.Web.Entry"
|
|
|
-
|
|
|
-if (-not (Test-Path $webDir)) { throw "Web directory not found: $webDir" }
|
|
|
-if (-not (Test-Path $entryDir)) { throw "Web.Entry directory not found: $entryDir" }
|
|
|
-
|
|
|
Write-Step "Install frontend dependencies + hooks"
|
|
|
Push-Location $webDir
|
|
|
try {
|
|
|
@@ -56,12 +63,12 @@ try {
|
|
|
}
|
|
|
|
|
|
Write-Step "Build backend core (net8.0)"
|
|
|
-Invoke-Checked "dotnet" @("build", "d:/Projects/Ai-DOP/SourceCode/references/Admin.NET/server/Admin.NET.Core/Admin.NET.Core.csproj", "--framework", "net8.0")
|
|
|
+Invoke-Checked "dotnet" @("build", $coreCsproj, "--framework", "net8.0")
|
|
|
|
|
|
if ($StartServices) {
|
|
|
Write-Step "Starting backend and frontend services"
|
|
|
Start-Process powershell -ArgumentList "-NoExit", "-Command", "Set-Location '$entryDir'; dotnet run --framework net8.0"
|
|
|
- Start-Process powershell -ArgumentList "-NoExit", "-Command", "Set-Location '$webDir'; npm run dev"
|
|
|
+ Start-Process powershell -ArgumentList "-NoExit", "-Command", "Set-Location '$webDir'; if (Get-Command pnpm -ErrorAction SilentlyContinue) { pnpm dev } else { npm run dev }"
|
|
|
Write-Step "Services started. Backend: http://localhost:5005 Frontend: http://localhost:8888"
|
|
|
}
|
|
|
|