Merge pull request #1893 from pypeclub/bugfix/python-detection

Bug: fixed python detection
This commit is contained in:
Ondřej Samohel 2021-08-03 11:07:46 +02:00 committed by GitHub
commit b3ad6d5147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 13 deletions

View file

@ -80,17 +80,6 @@ function Show-PSWarning() {
}
}
function Install-Poetry() {
Write-Host ">>> " -NoNewline -ForegroundColor Green
Write-Host "Installing Poetry ... "
$python = "python"
if (Get-Command "pyenv" -ErrorAction SilentlyContinue) {
$python = & pyenv which python
}
$env:POETRY_HOME="$openpype_root\.poetry"
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | & $($python) -
}
$art = @"
. . .. . ..

View file

@ -62,9 +62,12 @@ function Test-Python() {
Write-Host "Detecting host Python ... " -NoNewline
$python = "python"
if (Get-Command "pyenv" -ErrorAction SilentlyContinue) {
$python = & pyenv which python
$pyenv_python = & pyenv which python
if (Test-Path -PathType Leaf -Path "$($pyenv_python)") {
$python = $pyenv_python
}
}
if (-not (Get-Command "python3" -ErrorAction SilentlyContinue)) {
if (-not (Get-Command $python -ErrorAction SilentlyContinue)) {
Write-Host "!!! Python not detected" -ForegroundColor red
Set-Location -Path $current_dir
Exit-WithCode 1