chore: add root startup scripts
This commit is contained in:
42
dev.ps1
Normal file
42
dev.ps1
Normal file
@@ -0,0 +1,42 @@
|
||||
param(
|
||||
[switch]$FrontendOnly,
|
||||
[switch]$BackendOnly,
|
||||
[string]$DatabaseUrl = "postgres://postgres:postgres%402025%21@10.0.0.2:5432/termi-api_development"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$frontendScript = Join-Path $repoRoot "start-frontend.ps1"
|
||||
$backendScript = Join-Path $repoRoot "start-backend.ps1"
|
||||
|
||||
if ($FrontendOnly -and $BackendOnly) {
|
||||
throw "Use either -FrontendOnly or -BackendOnly, not both."
|
||||
}
|
||||
|
||||
if ($FrontendOnly) {
|
||||
& $frontendScript
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
if ($BackendOnly) {
|
||||
& $backendScript -DatabaseUrl $DatabaseUrl
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
Write-Host "[monorepo] Starting frontend and backend in separate PowerShell windows..." -ForegroundColor Cyan
|
||||
|
||||
Start-Process powershell -ArgumentList @(
|
||||
"-NoExit",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", $frontendScript
|
||||
)
|
||||
|
||||
Start-Process powershell -ArgumentList @(
|
||||
"-NoExit",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", $backendScript,
|
||||
"-DatabaseUrl", $DatabaseUrl
|
||||
)
|
||||
|
||||
Write-Host "[monorepo] Frontend window and backend window started." -ForegroundColor Green
|
||||
Reference in New Issue
Block a user