23 lines
574 B
PowerShell
23 lines
574 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
$projectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$pythonExe = Join-Path $projectRoot 'python\python.exe'
|
|
$backendDir = Join-Path $projectRoot 'backend'
|
|
|
|
if (-not (Test-Path $pythonExe)) {
|
|
throw "Project Python not found: $pythonExe"
|
|
}
|
|
|
|
if (-not (Test-Path (Join-Path $backendDir '.env'))) {
|
|
throw "Backend config not found: $backendDir\.env"
|
|
}
|
|
|
|
Push-Location $backendDir
|
|
try {
|
|
& $pythonExe -m alembic upgrade head
|
|
& $pythonExe -m uvicorn app.main:app --host 127.0.0.1 --port 8000
|
|
}
|
|
finally {
|
|
Pop-Location
|
|
}
|