Skip to content

Commit

Permalink
Improve logging for the run_command function
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed May 16, 2023
1 parent 2496423 commit b0dfd45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openandroidinstaller/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def run_command(
enable_logging: bool = True,
) -> TerminalResponse:
"""Run a command with a tool (adb, fastboot, heimdall)."""
yield f"${full_command}"
# split the command and extract the tool part
tool, *command = shlex.split(full_command)
if tool not in ["adb", "fastboot", "heimdall"]:
Expand All @@ -55,10 +54,11 @@ def run_command(
else:
command_list = [str(bin_path.joinpath(Path(f"{tool}")))] + command
si = None
if enable_logging:
logger.info(f"Run command: {command_list}")
if target:
command_list.append(f"{target}")
if enable_logging:
logger.info(f"Run command: {command_list}")
yield f"${full_command}"
# run the command
with subprocess.Popen(
command_list,
Expand Down

0 comments on commit b0dfd45

Please sign in to comment.