diff --git a/project_manager/common/command.py b/project_manager/common/command.py index 3220812..4e2164e 100644 --- a/project_manager/common/command.py +++ b/project_manager/common/command.py @@ -1,3 +1,4 @@ +import json import logging import os import subprocess @@ -43,7 +44,7 @@ class CommandExecutor: def __init__(self, command: str): self._command = command - def run(self, basepath: Path): + def run(self, basepath: Path) -> dict | None: self._logger.debug(self._command) out_logger = CommandLogger(logging.TRACE) err_logger = CommandLogger(logging.TRACE) @@ -59,5 +60,13 @@ class CommandExecutor: finally: out_logger.close() err_logger.close() + out_logger.join() + err_logger.join() if result.returncode != 0: raise CommandError("".join(err_logger.lines or out_logger.lines)) + if out_logger.lines: + try: + return json.loads(out_logger.lines[0]) + except json.JSONDecodeError: + pass + return None diff --git a/project_manager/entry/entry.py b/project_manager/entry/entry.py index 861ce13..47edf1a 100644 --- a/project_manager/entry/entry.py +++ b/project_manager/entry/entry.py @@ -70,7 +70,7 @@ class Entry: @property def sensentive_data(self): for k, v in self._variables.items(): - if "pass" in k.lower(): + if "pass" in k.lower() and v: yield v def show(self):