-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRun.ps1
40 lines (34 loc) · 1.08 KB
/
Run.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
# config/Header.yaml
$headerFile = Join-Path -Path $PSScriptRoot -ChildPath "config/Header.yaml"
if (Test-Path $headerFile) {
Remove-Item $headerFile -Force
Write-Host "Removed: $headerFile"
}
# output
$outputDir = Join-Path -Path $PSScriptRoot -ChildPath "output"
if (Test-Path $outputDir) {
Remove-Item $outputDir -Recurse -Force
Write-Host "Removed: $outputDir"
}
Start-Sleep -Seconds 1
# Python
$pythonInstalled = Get-Command python -ErrorAction SilentlyContinue
if (-not $pythonInstalled) {
$installPythonScript = Join-Path -Path $PSScriptRoot -ChildPath "python/install_python2.ps1"
Write-Host "Python Not Found $installPythonScript"
& $installPythonScript
Exit
}
# pip
$pipInstalled = python -m pip --version 2>$null
if ($LASTEXITCODE -ne 0) {
$installPipScript = Join-Path -Path $PSScriptRoot -ChildPath "pip/get-pip.ps1"
Write-Host "Pip Not Found $installPipScript"
& $installPipScript
Exit
}
# init.py
$initScript = Join-Path -Path $PSScriptRoot -ChildPath "init.py"
Write-Host "Run: $initScript"
python $initScript
Start-Sleep -Seconds 3