mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
check for build and venv dirs
This commit is contained in:
parent
b88f2a8461
commit
47b4385947
3 changed files with 32 additions and 3 deletions
|
|
@ -23,6 +23,7 @@ def main(ctx):
|
|||
@main.command()
|
||||
@click.option("-d", "--dev", is_flag=True, help="Settings in Dev mode")
|
||||
def settings(dev=False):
|
||||
"""Show Pype Settings UI."""
|
||||
PypeCommands().launch_settings_gui(dev)
|
||||
|
||||
|
||||
|
|
@ -280,7 +281,7 @@ def generate_zip(path):
|
|||
allow_extra_args=True))
|
||||
@click.argument("script", required=True, type=click.Path(exists=True))
|
||||
def run(script):
|
||||
"""Run python script."""
|
||||
"""Run python script in Pype context."""
|
||||
import runpy
|
||||
|
||||
if not script:
|
||||
|
|
|
|||
|
|
@ -98,9 +98,22 @@ if (-not $pype_version) {
|
|||
Exit-WithCode 1
|
||||
}
|
||||
|
||||
# Create build directory if not exist
|
||||
if (-not (Test-Path -PathType Container -Path "$($pype_root)\build")) {
|
||||
New-Item -ItemType Directory -Force -Path "$($pype_root)\build"
|
||||
}
|
||||
|
||||
Write-Host "--- " -NoNewline -ForegroundColor yellow
|
||||
Write-Host "Cleaning build directory ..."
|
||||
Remove-Item -Recurse -Force "$($pype_root)\build\*"
|
||||
try {
|
||||
Remove-Item -Recurse -Force "$($pype_root)\build\*"
|
||||
}
|
||||
catch {
|
||||
Write-Host "!!! " -NoNewline -ForegroundColor Red
|
||||
Write-Host "Cannot clean build directory, possibly because process is using it."
|
||||
Write-Host $_.Exception.Message
|
||||
Exit-WithCode 1
|
||||
}
|
||||
|
||||
Write-Host ">>> " -NoNewline -ForegroundColor green
|
||||
Write-Host "Building Pype [ " -NoNewline -ForegroundColor white
|
||||
|
|
|
|||
|
|
@ -87,9 +87,24 @@ if(($matches[1] -lt 3) -or ($matches[2] -lt 7)) {
|
|||
}
|
||||
Write-Host "OK [ $p ]" -ForegroundColor green
|
||||
|
||||
# Create venv directory if not exist
|
||||
if (-not (Test-Path -PathType Container -Path "$($pype_root)\venv")) {
|
||||
New-Item -ItemType Directory -Force -Path "$($pype_root)\venv"
|
||||
}
|
||||
|
||||
Write-Host "--- " -NoNewline -ForegroundColor yellow
|
||||
Write-Host "Cleaning venv directory ..."
|
||||
Remove-Item -Recurse -Force "$($pype_root)\venv\*"
|
||||
|
||||
try {
|
||||
Remove-Item -Recurse -Force "$($pype_root)\venv\*"
|
||||
}
|
||||
catch {
|
||||
Write-Host "!!! " -NoNewline -ForegroundColor red
|
||||
Write-Host "Cannot clean venv directory, possibly another process is using it."
|
||||
Write-Host $_.Exception.Message
|
||||
Exit-WithCode 1
|
||||
}
|
||||
|
||||
|
||||
Write-Host ">>> " -NoNewline -ForegroundColor green
|
||||
Write-Host "Creating virtual env ..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue