mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
added global prelaunch hook for mac prepending open -an arguments
This commit is contained in:
parent
1e1209c202
commit
f3cbc1550a
1 changed files with 18 additions and 0 deletions
18
openpype/hooks/pre_mac_launch.py
Normal file
18
openpype/hooks/pre_mac_launch.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from openpype.lib import PreLaunchHook
|
||||
|
||||
|
||||
class LaunchWithTerminal(PreLaunchHook):
|
||||
"""Mac specific pre arguments for application.
|
||||
|
||||
Mac applications should be launched using "open" argument which is internal
|
||||
callbacks to open executable. We also add argument "-an" to create new
|
||||
process. This is used only for executables ending with ".app". It is
|
||||
expected that these executables lead to app packages.
|
||||
"""
|
||||
order = 1000
|
||||
|
||||
platforms = ["darwin"]
|
||||
|
||||
def execute(self):
|
||||
if self.launch_context.executable.endswith(".app"):
|
||||
self.launch_context.launch_args.insert(0, ["open", "-an"])
|
||||
Loading…
Add table
Add a link
Reference in a new issue