-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
37 lines (27 loc) · 970 Bytes
/
Copy pathsetup.ps1
File metadata and controls
37 lines (27 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
param(
[switch]$SkipFrontend
)
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $root
$venvPython = Join-Path $root ".venv\Scripts\python.exe"
if (-not (Test-Path $venvPython)) {
Write-Host "Creating local virtual environment in .venv..."
python -m venv .venv
}
$venvPython = Join-Path $root ".venv\Scripts\python.exe"
Write-Host "Upgrading pip..."
& $venvPython -m pip install --upgrade pip
Write-Host "Installing Python dependencies..."
& $venvPython -m pip install -r requirements.txt -r api\requirements.txt -e .
if ((-not (Test-Path ".env")) -and (Test-Path ".env.example")) {
Write-Host "Creating .env from .env.example..."
Copy-Item ".env.example" ".env"
}
if (-not $SkipFrontend) {
Write-Host "Installing frontend dependencies..."
npm install --prefix frontend
}
Write-Host ""
Write-Host "Setup complete."
Write-Host "Run .\run-dev.cmd to start the backend and frontend."