Kansho/scripts/dev-setup.ps1

20 lines
682 B
PowerShell

$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $PSScriptRoot
$py = "$env:LOCALAPPDATA\Programs\Python\Python312\python.exe"
if (-not (Test-Path $py)) {
$py = "python"
}
$venv = Join-Path $root "backend\.venv\Scripts\python.exe"
if (-not (Test-Path $venv)) {
& $py -m venv (Join-Path $root "backend\.venv")
}
& (Join-Path $root "backend\.venv\Scripts\python.exe") -m pip install -r (Join-Path $root "backend\requirements.txt")
Push-Location (Join-Path $root "frontend")
npm install
Pop-Location
Write-Host "Backend: cd backend; .\.venv\Scripts\python -m uvicorn main:app --reload --port 8018"
Write-Host "Frontend: cd frontend; npm run dev (Port 5188, strict)"