Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

escape executables in pre launch hooks #940

Merged
merged 5 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pype/hooks/aftereffects/pre_launch_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def execute(self):
(
"import avalon.aftereffects;"
"avalon.aftereffects.launch(\"{}\")"
).format(aftereffects_executable)
).format(aftereffects_executable.replace("\\", "\\\\"))
]

# Append as whole list as these areguments should not be separated
Expand Down
2 changes: 1 addition & 1 deletion pype/hooks/harmony/pre_launch_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def execute(self):
(
"import avalon.harmony;"
"avalon.harmony.launch(\"{}\")"
).format(harmony_executable.replace("\\", "/"))
).format(harmony_executable.replace("\\", "\\\\"))
]

# Append as whole list as these areguments should not be separated
Expand Down
11 changes: 9 additions & 2 deletions pype/hooks/photoshop/pre_launch_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ def execute(self):
while self.launch_context.launch_args:
remainders.append(self.launch_context.launch_args.pop(0))

workfile_path = self.data["last_workfile_path"]
if not os.path.exists(workfile_path):
workfile_path = ""

new_launch_args = [
self.python_executable(),
"-c",
(
"import avalon.photoshop;"
"avalon.photoshop.launch(\"{}\")"
).format(photoshop_executable)
"avalon.photoshop.launch(\"{}\", \"{}\")"
).format(
photoshop_executable.replace("\\", "\\\\"),
workfile_path.replace("\\", "\\\\")
)
]

# Append as whole list as these areguments should not be separated
Expand Down
131 changes: 0 additions & 131 deletions pype/hooks/photoshop/prelaunch.py

This file was deleted.