From f78bb8b711a787f74107975d8f9d5f6d9ccafe6d Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Thu, 21 Jan 2021 19:57:38 -0800 Subject: [PATCH] Attempt to display the Timer progress and logs in separate parts of the screen when running the importer. #262 Lots of problems, so disabled by default. --- import.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/import.sh b/import.sh index 1e632fa60a..81526257e5 100755 --- a/import.sh +++ b/import.sh @@ -1,3 +1,21 @@ #!/bin/bash -RUST_BACKTRACE=1 cargo run --bin importer --release --manifest-path importer/Cargo.toml --features scenarios -- $@; +# If true, display importer progress from the Timer (dumped to STDOUT) in one +# pane, and all logs (on STDERR) in another. This is disabled by default until +# some issues with multitail are fixed: +# +# 1) Automatically exit when the importer is done +# 2) Stop having part of the logs blink +# 3) Get the \r / clear-line thing working for the Timer +USE_MULTITAIL=false + +if ! command -v multitail &> /dev/null; then + USE_MULTITAIL=false +fi + +if $USE_MULTITAIL; then + RUST_BACKTRACE=1 RUST_LOG_STYLE=always cargo run --bin importer --release --manifest-path importer/Cargo.toml --features scenarios -- $@ > /tmp/abst_stdout 2> /tmp/abst_stderr & + multitail /tmp/abst_stdout -cT ANSI /tmp/abst_stderr +else + RUST_BACKTRACE=1 cargo run --bin importer --release --manifest-path importer/Cargo.toml --features scenarios -- $@ +fi