Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print command during dry mode, regardless of log level #208

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 4 additions & 2 deletions ffmpeg_normalize/_cmd_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import re
import subprocess
from platform import system
from shlex import quote
from shutil import which
from typing import Iterator

Expand Down Expand Up @@ -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.
Expand Down