From 0bac48f1eaf49905feeb3a055e4e758f3ee27eed Mon Sep 17 00:00:00 2001 From: Zapta Date: Sun, 17 Nov 2024 09:58:09 -0800 Subject: [PATCH] Fixed an error when 'apio packages --list' is piped out. --- apio/pkg_util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apio/pkg_util.py b/apio/pkg_util.py index 450fa661..2367cba2 100644 --- a/apio/pkg_util.py +++ b/apio/pkg_util.py @@ -344,9 +344,10 @@ def scan_packages(resources: Resources) -> PackageScanResults: def _list_section(title: str, items: List[List[str]], color: str) -> None: """A helper function for printing one serction of list_packages().""" # -- Construct horizontal lines at terminal width. - output_config = util.get_terminal_config() - line = "─" * output_config.terminal_width - dline = "═" * output_config.terminal_width + config = util.get_terminal_config() + line_width = config.terminal_width if config.terminal_mode() else 80 + line = "─" * line_width + dline = "═" * line_width # -- Print the section. click.secho()