-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup-windows.ps1
41 lines (22 loc) · 1015 Bytes
/
setup-windows.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
#!/usr/bin/env pwsh
function downloadZipFromGit {
$homeDir = [Environment]::GetFolderPath('UserProfile')
New-Item -ItemType Directory -Path "$homeDir\smwcentral-scraper"
Set-Location -Path "$homeDir\smwcentral-scraper"
Invoke-WebRequest -Uri 'https://github.com/divSelector/smwcentral-scraper/archive/refs/heads/main.zip' -OutFile 'smwcentral-scraper.zip'
Expand-Archive -Path "smwcentral-scraper.zip" -DestinationPath "$HOME\smwcentral-scraper"
Get-ChildItem -Directory | Select-Object -First 1 | Set-Location
Remove-Item ..\smwcentral-scraper.zip
Get-ChildItem -Recurse | Move-Item -Destination ..
Set-Location ..
Get-ChildItem -Directory | Where-Object { (Get-ChildItem $_.FullName -Recurse -Force).Count -eq 0 } | Remove-Item -Recurse -Force
}
function setupVirtualEnv {
py -m pip install virtualenv
py -m virtualenv venv
.\venv\Scripts\activate
py -m pip install --upgrade pip
py -m pip install -r .\requirements.txt
}
#downloadZipFromGit
setupVirtualEnv