BRE/script/LocalDevSetup.ps1

32 lines
762 B
PowerShell
Raw Normal View History

2024-06-07 19:50:21 +03:00
# Create venv and install dependencies + imports
$webapi = Resolve-Path -Path "$PSScriptRoot\..\webapi"
$envPath = "$webapi\venv"
$python = "$envPath\Scripts\python.exe"
function LocalDevelopmentSetup() {
Set-Location $webapi
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
& $python -m pip install -r requirements_dev.txt
}
LocalDevelopmentSetup