mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
use new functions in cli.py
This commit is contained in:
parent
1d8d417e53
commit
b0927595a2
1 changed files with 12 additions and 9 deletions
|
|
@ -8,7 +8,6 @@ from pathlib import Path
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import acre
|
|
||||||
|
|
||||||
from ayon_core import AYON_CORE_ROOT
|
from ayon_core import AYON_CORE_ROOT
|
||||||
from ayon_core.addon import AddonsManager
|
from ayon_core.addon import AddonsManager
|
||||||
|
|
@ -18,6 +17,11 @@ from ayon_core.lib import (
|
||||||
is_running_from_build,
|
is_running_from_build,
|
||||||
Logger,
|
Logger,
|
||||||
)
|
)
|
||||||
|
from ayon_core.lib.env_tools import (
|
||||||
|
parse_env_variables_structure,
|
||||||
|
compute_env_variables_structure,
|
||||||
|
merge_env_variables,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -240,14 +244,13 @@ def _set_global_environments() -> None:
|
||||||
# first resolve general environment because merge doesn't expect
|
# first resolve general environment because merge doesn't expect
|
||||||
# values to be list.
|
# values to be list.
|
||||||
# TODO: switch to AYON environment functions
|
# TODO: switch to AYON environment functions
|
||||||
merged_env = acre.merge(
|
merged_env = merge_env_variables(
|
||||||
acre.compute(acre.parse(general_env), cleanup=False),
|
compute_env_variables_structure(
|
||||||
|
parse_env_variables_structure(general_env)
|
||||||
|
),
|
||||||
dict(os.environ)
|
dict(os.environ)
|
||||||
)
|
)
|
||||||
env = acre.compute(
|
env = compute_env_variables_structure(merged_env)
|
||||||
merged_env,
|
|
||||||
cleanup=False
|
|
||||||
)
|
|
||||||
os.environ.clear()
|
os.environ.clear()
|
||||||
os.environ.update(env)
|
os.environ.update(env)
|
||||||
|
|
||||||
|
|
@ -263,8 +266,8 @@ def _set_addons_environments(addons_manager):
|
||||||
|
|
||||||
# Merge environments with current environments and update values
|
# Merge environments with current environments and update values
|
||||||
if module_envs := addons_manager.collect_global_environments():
|
if module_envs := addons_manager.collect_global_environments():
|
||||||
parsed_envs = acre.parse(module_envs)
|
parsed_envs = parse_env_variables_structure(module_envs)
|
||||||
env = acre.merge(parsed_envs, dict(os.environ))
|
env = merge_env_variables(parsed_envs, dict(os.environ))
|
||||||
os.environ.clear()
|
os.environ.clear()
|
||||||
os.environ.update(env)
|
os.environ.update(env)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue