2020-03-26 20:26:01 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-01-22 06:57:38 +03:00
|
|
|
# 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
|
|
|
|
|
2021-06-24 22:13:47 +03:00
|
|
|
SPEED=--release
|
|
|
|
if [ "$1" == "--dev" ]; then
|
|
|
|
shift
|
|
|
|
SPEED=
|
|
|
|
fi
|
|
|
|
|
2021-01-22 06:57:38 +03:00
|
|
|
if ! command -v multitail &> /dev/null; then
|
|
|
|
USE_MULTITAIL=false
|
|
|
|
fi
|
|
|
|
|
|
|
|
if $USE_MULTITAIL; then
|
2021-06-24 22:13:47 +03:00
|
|
|
RUST_BACKTRACE=1 RUST_LOG_STYLE=always cargo run --bin importer $SPEED --manifest-path importer/Cargo.toml --features scenarios -- $@ > /tmp/abst_stdout 2> /tmp/abst_stderr &
|
2021-01-22 06:57:38 +03:00
|
|
|
multitail /tmp/abst_stdout -cT ANSI /tmp/abst_stderr
|
|
|
|
else
|
2021-06-24 22:13:47 +03:00
|
|
|
RUST_BACKTRACE=1 cargo run --bin importer $SPEED --manifest-path importer/Cargo.toml --features scenarios -- $@
|
2021-01-22 06:57:38 +03:00
|
|
|
fi
|