diff --git a/ffmpeg_normalize/_cmd_utils.py b/ffmpeg_normalize/_cmd_utils.py index 5a9049a..c025ffa 100644 --- a/ffmpeg_normalize/_cmd_utils.py +++ b/ffmpeg_normalize/_cmd_utils.py @@ -5,6 +5,7 @@ import re import subprocess from platform import system +from shlex import quote from shutil import which from typing import Iterator @@ -129,12 +130,13 @@ def run_command(self) -> None: Raises: RuntimeError: If command returns non-zero exit code """ - logger.debug(f"Running command: {self.cmd}") if self.dry: - logger.debug("Dry mode specified, not actually running command") + print(" ".join([quote(c) for c in self.cmd])) return + logger.debug(f"Running command: {self.cmd}") + p = subprocess.Popen( self.cmd, stdin=subprocess.PIPE, # Apply stdin isolation by creating separate pipe.