From f775da299a3e5611bfd18ad37416b2d86c108eb4 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 3 Jan 2024 20:12:03 -0800 Subject: [PATCH] show command to enter docker container in failed command output hint when IN_DOCKER=True --- archivebox/logging_util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py index f0155702..3c688a3c 100644 --- a/archivebox/logging_util.py +++ b/archivebox/logging_util.py @@ -448,12 +448,18 @@ def log_archive_method_finished(result: "ArchiveResult"): for line in list(hints)[:5] if line.strip() ) + docker_hints = () + if IN_DOCKER: + docker_hints = ( + ' docker run -it -v $PWD/data:/data archivebox/archivebox /bin/bash', + ) # Collect and prefix output lines with indentation output_lines = [ *hint_header, *hints, '{}Run to see full output:{}'.format(ANSI['lightred'], ANSI['reset']), + *docker_hints, *([' cd {};'.format(result.pwd)] if result.pwd else []), ' {}'.format(quoted_cmd), ]