Skip to content

Commit

Permalink
excape parenthesis for shell
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Aug 26, 2024
1 parent e5801be commit 714f58f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/ayon_core/plugins/publish/extract_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,13 @@ def _render_output_definitions(
raise NotImplementedError

subprcs_cmd = " ".join(ffmpeg_args)
if os.getenv("SHELL") in ("/bin/bash", "/bin/sh"):
# Escape parentheses for bash
subprcs_cmd = (
subprcs_cmd
.replace("(", "\\(")
.replace(")", "\\)")
)

# run subprocess
self.log.debug("Executing: {}".format(subprcs_cmd))
Expand Down
7 changes: 7 additions & 0 deletions client/ayon_core/plugins/publish/extract_review_slate.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ def process(self, instance):
" ".join(output_args)
]
slate_subprocess_cmd = " ".join(slate_args)
if os.getenv("SHELL") in ("/bin/bash", "/bin/sh"):
# Escape parentheses for bash
slate_subprocess_cmd = (
slate_subprocess_cmd
.replace("(", "\\(")
.replace(")", "\\)")
)

# run slate generation subprocess
self.log.debug(
Expand Down
8 changes: 8 additions & 0 deletions client/ayon_core/plugins/publish/extract_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ def _create_thumbnail_ffmpeg(self, src_path, dst_path):
# output file
jpeg_items.append(path_to_subprocess_arg(dst_path))
subprocess_command = " ".join(jpeg_items)
if os.getenv("SHELL") in ("/bin/bash", "/bin/sh"):
# Escape parentheses for bash
subprocess_command = (
subprocess_command
.replace("(", "\\(")
.replace(")", "\\)")
)

try:
run_subprocess(
subprocess_command, shell=True, logger=self.log
Expand Down

0 comments on commit 714f58f

Please sign in to comment.