excape parenthesis for shell

This commit is contained in:
Jakub Trllo 2024-08-26 11:10:54 +02:00
parent e5801be670
commit 714f58fbd6
3 changed files with 22 additions and 0 deletions

View file

@ -454,6 +454,13 @@ class ExtractReview(pyblish.api.InstancePlugin):
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))

View file

@ -269,6 +269,13 @@ class ExtractReviewSlate(publish.Extractor):
" ".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(

View file

@ -455,6 +455,14 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
# 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