ConceptPortal-public/scripts/dev/LocalDevSetup.ps1

43 lines
1016 B
PowerShell
Raw Normal View History

# Create venv and install dependencies + imports
$backend = Resolve-Path -Path "$PSScriptRoot\..\..\rsconcept\backend"
2023-09-07 16:53:18 +03:00
$frontend = Resolve-Path -Path "$PSScriptRoot\..\..\rsconcept\frontend"
$envPath = "$backend\venv"
$python = "$envPath\Scripts\python.exe"
function LocalDevelopmentSetup() {
FrontendSetup
BackendSetup
}
function FrontendSetup() {
Set-Location $frontend
2023-09-10 21:34:04 +03:00
& npm install
}
function BackendSetup() {
Set-Location $backend
ClearPrevious
CreateEnv
InstallPips
}
function ClearPrevious() {
if (Test-Path -Path $envPath) {
Write-Host "Removing previous env: $envPath`n" -ForegroundColor DarkGreen
Remove-Item $envPath -Recurse -Force
}
}
function CreateEnv() {
Write-Host "Creating python env: $envPath`n" -ForegroundColor DarkGreen
& 'python' -m venv $envPath
}
function InstallPips() {
& $python -m pip install --upgrade pip
2024-04-17 23:08:40 +03:00
& $python -m pip install -r requirements-dev.txt --no-warn-script-location
}
LocalDevelopmentSetup