-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.ps1
43 lines (32 loc) · 1.09 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
# This script will create a virtualenv and auto install
# all dependencies that are needed for this program
function Green
{
process { Write-Host $_ -ForegroundColor Green }
}
function Red
{
process { Write-Host $_ -ForegroundColor Red }
}
function Yellow
{
process { Write-Host $_ -ForegroundColor Yellow }
}
# opens directory in which the script is located
cd $PSScriptRoot
Write-Output "Working Dir:" | Green
Write-Output $PSScriptRoot | Yellow
Write-Output "Installing virtualenv" | Green
pip install virtualenv
Write-Output "Creating virtualenv" | Green
python -m virtualenv .venv
Write-Output "Activating virtualenv" | Green
.\.venv\Scripts\activate
Write-Output "Installing dependencies" | Green
pip install -r .\requirements.txt
Write-Output "Creating activate.ps1" | Green
# to acticvate the virtualenv using autofill instead of entering the directory path given below
".\.venv\Scripts\activate" > activate.ps1
# do deactivate the virtualenv just enter deactivate in the terminal
Write-Output "Done" | Green
Write-Output "Use '.\activate.ps1' to enable virtualenv in future uses" | Green