mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
clean zips files, fix shared version location
This commit is contained in:
parent
67b7e8071f
commit
33df862d1d
3 changed files with 25 additions and 6 deletions
|
|
@ -622,7 +622,7 @@ class BootstrapRepos:
|
||||||
" not implemented yet."))
|
" not implemented yet."))
|
||||||
|
|
||||||
dir_to_search = self.data_dir
|
dir_to_search = self.data_dir
|
||||||
|
user_versions = self.get_openpype_versions(self.data_dir, staging)
|
||||||
# if we have openpype_path specified, search only there.
|
# if we have openpype_path specified, search only there.
|
||||||
if openpype_path:
|
if openpype_path:
|
||||||
dir_to_search = openpype_path
|
dir_to_search = openpype_path
|
||||||
|
|
@ -642,6 +642,7 @@ class BootstrapRepos:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
openpype_versions = self.get_openpype_versions(dir_to_search, staging)
|
openpype_versions = self.get_openpype_versions(dir_to_search, staging)
|
||||||
|
openpype_versions += user_versions
|
||||||
|
|
||||||
# remove zip file version if needed.
|
# remove zip file version if needed.
|
||||||
if not include_zips:
|
if not include_zips:
|
||||||
|
|
@ -754,12 +755,13 @@ class BootstrapRepos:
|
||||||
|
|
||||||
destination = self.data_dir / version.path.stem
|
destination = self.data_dir / version.path.stem
|
||||||
if destination.exists():
|
if destination.exists():
|
||||||
|
assert destination.is_dir()
|
||||||
try:
|
try:
|
||||||
destination.unlink()
|
shutil.rmtree(destination)
|
||||||
except OSError:
|
except OSError as e:
|
||||||
msg = f"!!! Cannot remove already existing {destination}"
|
msg = f"!!! Cannot remove already existing {destination}"
|
||||||
self._print(msg, LOG_ERROR, exc_info=True)
|
self._print(msg, LOG_ERROR, exc_info=True)
|
||||||
return None
|
raise e
|
||||||
|
|
||||||
destination.mkdir(parents=True)
|
destination.mkdir(parents=True)
|
||||||
|
|
||||||
|
|
|
||||||
17
start.py
17
start.py
|
|
@ -427,6 +427,13 @@ def _find_frozen_openpype(use_version: str = None,
|
||||||
path=Path(os.environ["OPENPYPE_ROOT"]))
|
path=Path(os.environ["OPENPYPE_ROOT"]))
|
||||||
if local_version not in openpype_versions:
|
if local_version not in openpype_versions:
|
||||||
openpype_versions.append(local_version)
|
openpype_versions.append(local_version)
|
||||||
|
openpype_versions.sort()
|
||||||
|
# if latest is currently running, ditch whole list
|
||||||
|
# and run from current without installing it.
|
||||||
|
if local_version == openpype_versions[-1]:
|
||||||
|
os.environ["OPENPYPE_TRYOUT"] = "1"
|
||||||
|
openpype_versions = []
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("!!! Warning: cannot determine current running version.")
|
print("!!! Warning: cannot determine current running version.")
|
||||||
|
|
||||||
|
|
@ -502,7 +509,15 @@ def _find_frozen_openpype(use_version: str = None,
|
||||||
|
|
||||||
if openpype_version.path.is_file():
|
if openpype_version.path.is_file():
|
||||||
print(">>> Extracting zip file ...")
|
print(">>> Extracting zip file ...")
|
||||||
version_path = bootstrap.extract_openpype(openpype_version)
|
try:
|
||||||
|
version_path = bootstrap.extract_openpype(openpype_version)
|
||||||
|
except OSError as e:
|
||||||
|
print("!!! failed: {}".format(str(e)))
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
# cleanup zip after extraction
|
||||||
|
os.unlink(openpype_version.path)
|
||||||
|
|
||||||
openpype_version.path = version_path
|
openpype_version.path = version_path
|
||||||
|
|
||||||
_initialize_environment(openpype_version)
|
_initialize_environment(openpype_version)
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ Write-Host "OK" -ForegroundColor green
|
||||||
|
|
||||||
Write-Host ">>> " -NoNewline -ForegroundColor green
|
Write-Host ">>> " -NoNewline -ForegroundColor green
|
||||||
Write-Host "Building OpenPype ..."
|
Write-Host "Building OpenPype ..."
|
||||||
|
$startTime = (Get-Date).Millisecond
|
||||||
|
|
||||||
$out = & poetry run python setup.py build 2>&1
|
$out = & poetry run python setup.py build 2>&1
|
||||||
if ($LASTEXITCODE -ne 0)
|
if ($LASTEXITCODE -ne 0)
|
||||||
|
|
@ -182,7 +183,8 @@ Write-Host ">>> " -NoNewline -ForegroundColor green
|
||||||
Write-Host "restoring current directory"
|
Write-Host "restoring current directory"
|
||||||
Set-Location -Path $current_dir
|
Set-Location -Path $current_dir
|
||||||
|
|
||||||
|
$endTime = (Get-Date).Millisecond
|
||||||
Write-Host "*** " -NoNewline -ForegroundColor Cyan
|
Write-Host "*** " -NoNewline -ForegroundColor Cyan
|
||||||
Write-Host "All done. You will find OpenPype and build log in " -NoNewLine
|
Write-Host "All done in $($endTime - $startTime) secs. You will find OpenPype and build log in " -NoNewLine
|
||||||
Write-Host "'.\build'" -NoNewline -ForegroundColor Green
|
Write-Host "'.\build'" -NoNewline -ForegroundColor Green
|
||||||
Write-Host " directory."
|
Write-Host " directory."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue