"platforms/common/vscode:/vscode.git/clone" did not exist on "09d17766b0b9ee059da7e899a435781da05c9479"
Commit e268b8f6 authored by mattip's avatar mattip
Browse files

generalize the script, assuming we always want revision 0 (3.8.0rc1 here)

parent 8623a661
...@@ -80,5 +80,5 @@ test_script: ...@@ -80,5 +80,5 @@ test_script:
- ps: .\install_python.ps1 - ps: .\install_python.ps1
- set PYTHON=C:\Python37-x64 - set PYTHON=C:\Python37-x64
- ps: .\install_python.ps1 - ps: .\install_python.ps1
- set PYTHON=C:\Python38-x64 - set PYTHON=C:\Python38rc1-x64
- ps: .\install_python.ps1 - ps: .\install_python.ps1
...@@ -7,8 +7,9 @@ $py_exe = "${env:PYTHON}\Python.exe" ...@@ -7,8 +7,9 @@ $py_exe = "${env:PYTHON}\Python.exe"
if ( [System.IO.File]::Exists($py_exe) ) { if ( [System.IO.File]::Exists($py_exe) ) {
exit 0 exit 0
} }
$req_nodot = $env:PYTHON -replace '\D+Python(\d+)(?:-x64)?','$1' $req_nodot = $env:PYTHON -replace '\D+Python(\d+(?:rc\d+))(?:-x64)?','$1'
$req_ver = $req_nodot -replace '(\d)(\d+)','$1.$2.0' $req_ver = $req_nodot -replace '(\d)(\d+)','$1.$2.0'
$req_dir = $req_nodot -replace '(\d)(\d+)(.*)','$1.$2.0'
if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") { if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") {
$exe_suffix="-amd64" $exe_suffix="-amd64"
...@@ -21,13 +22,7 @@ if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") { ...@@ -21,13 +22,7 @@ if ($env:PYTHON -eq "C:\Python${req_nodot}-x64") {
$py_url = "https://www.python.org/ftp/python" $py_url = "https://www.python.org/ftp/python"
Write-Host "Installing Python ${req_ver}$exe_suffix..." -ForegroundColor Cyan Write-Host "Installing Python ${req_ver}$exe_suffix..." -ForegroundColor Cyan
$exePath = "$env:TEMP\python-${req_ver}${exe_suffix}.exe" $exePath = "$env:TEMP\python-${req_ver}${exe_suffix}.exe"
$downloadFile = "$py_url/${req_dir}/python-${req_ver}${exe_suffix}.exe"
if ($req_nodot -eq "38") {
$downloadFile = "$py_url/${req_ver}/python-${req_ver}rc1${exe_suffix}.exe"
}
else {
$downloadFile = "$py_url/${req_ver}/python-${req_ver}${exe_suffix}.exe"
}
Write-Host "Downloading $downloadFile..." Write-Host "Downloading $downloadFile..."
(New-Object Net.WebClient).DownloadFile($downloadFile, $exePath) (New-Object Net.WebClient).DownloadFile($downloadFile, $exePath)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment