-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.ps1
45 lines (40 loc) · 1.44 KB
/
setup.ps1
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
38
39
40
41
42
43
44
45
# Installing all Dependencies
if ("--venv" -in $args) {
if (Test-Path .\virtualenv) {
$deactivate_venv = Get-Command deactivate -ErrorAction SilentlyContinue
if ($deactivate_venv) {
Write-Host "[! ] Deactivating active virtual environment" -ForegroundColor DarkGray
. $deactivate_venv
}
Write-Host "[!!] Removing old virtual environment" -ForegroundColor DarkGray
Remove-Item .\virtualenv -Force -Recurse
}
Write-Host "`n[0/2] Creating new virtual python environment" -ForegroundColor Cyan
python -m venv .\virtualenv
. .\virtualenv\Scripts\Activate.ps1
if ($LASTEXITCODE -ne 0) {
Write-Host ">> Aborting Setup" -ForegroundColor Red
exit -1
} else {
Write-Host ">> Done" -ForegroundColor Green
}
}
Write-Host "`n[1/2] Installing main dependencies" -ForegroundColor Cyan
pip install -r .\requirements.txt
if ($LASTEXITCODE -ne 0) {
Write-Host ">> Aborting" -ForegroundColor Red
exit -1
} else {
Write-Host ">> Done" -ForegroundColor Green
}
Write-Host "`n[2/2] Checking other dependencies" -ForegroundColor Cyan
Write-Host "$ Installing GDAL.." -ForegroundColor Cyan
pip install .\lib\GDAL-3.4.2-cp37-cp37m-win_amd64.whl
if ($LASTEXITCODE -ne 0) {
Write-Host ">> Aborting" -ForegroundColor Red
exit -1
}
else {
Write-Host ">> Done" -ForegroundColor Green
}
Write-Host "`n`nSUCCESS: Setup completed" -ForegroundColor Green