From 3cdfa67ff655bbacafe693aebb47331963ebbc9b Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Fri, 5 Aug 2022 16:18:51 +0000 Subject: [PATCH] Add ExecutorTarget.convert_shell_command --- podman_compose_tools/executor/execution.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/podman_compose_tools/executor/execution.py b/podman_compose_tools/executor/execution.py index 8d5770e..749153e 100644 --- a/podman_compose_tools/executor/execution.py +++ b/podman_compose_tools/executor/execution.py @@ -58,6 +58,9 @@ class ExecutorTarget(metaclass=abc.ABCMeta): ) ) + def convert_shell_command(self, shell_cmd: ShellCommandStr) -> CommandArgs: + return CommandArgs([self.found_shell, "-c", str(shell_cmd)]) + def exec_shell( self, *, @@ -67,7 +70,7 @@ class ExecutorTarget(metaclass=abc.ABCMeta): work_dir: Optional[PurePath], ) -> CompletedExec: return self.exec_cmd( - command=CommandArgs([self.found_shell, "-c", shell_cmd]), + command=self.convert_shell_command(shell_cmd=shell_cmd), check=check, capture_stdout=capture_stdout, work_dir=work_dir,