mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
17 lines
453 B
Python
17 lines
453 B
Python
from openpype.lib import PreLaunchHook
|
|
|
|
|
|
class SetPath(PreLaunchHook):
|
|
"""Set current dir to workdir.
|
|
|
|
Hook `GlobalHostDataHook` must be executed before this hook.
|
|
"""
|
|
app_groups = ["max"]
|
|
|
|
def execute(self):
|
|
workdir = self.launch_context.env.get("AVALON_WORKDIR", "")
|
|
if not workdir:
|
|
self.log.warning("BUG: Workdir is not filled.")
|
|
return
|
|
|
|
self.launch_context.kwargs["cwd"] = workdir
|