ayon-core/tools/run_settings.ps1
2021-07-09 12:27:23 +02:00

40 lines
No EOL
1.1 KiB
PowerShell

<#
.SYNOPSIS
Helper script to OpenPype Settings UI
.DESCRIPTION
This script will run OpenPype and open Settings UI.
.EXAMPLE
PS> .\run_settings.ps1
#>
$current_dir = Get-Location
$script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName
$env:_INSIDE_OPENPYPE_TOOL = "1"
# make sure Poetry is in PATH
if (-not (Test-Path 'env:POETRY_HOME')) {
$env:POETRY_HOME = "$openpype_root\.poetry"
}
$env:PATH = "$($env:PATH);$($env:POETRY_HOME)\bin"
Set-Location -Path $openpype_root
Write-Host ">>> " -NoNewline -ForegroundColor Green
Write-Host "Reading Poetry ... " -NoNewline
if (-not (Test-Path -PathType Container -Path "$($env:POETRY_HOME)\bin")) {
Write-Host "NOT FOUND" -ForegroundColor Yellow
Write-Host "*** " -NoNewline -ForegroundColor Yellow
Write-Host "We need to install Poetry create virtual env first ..."
& "$openpype_root\tools\create_env.ps1"
} else {
Write-Host "OK" -ForegroundColor Green
}
& "$env:POETRY_HOME\bin\poetry" run python "$($openpype_root)\start.py" settings --dev
Set-Location -Path $current_dir