Make run stream the output
This commit is contained in:
parent
69f8acad8f
commit
3dc9930dbb
3 changed files with 9 additions and 2 deletions
|
|
@ -27,9 +27,12 @@ set -euo pipefail
|
|||
# helper functions inspired by bats/bats-assert
|
||||
run() {
|
||||
set +e
|
||||
output="$("$@" 2>&1)"
|
||||
status=$?
|
||||
tmp_output="$(mktemp)"
|
||||
"$@" 2>&1 | tee "$tmp_output"
|
||||
status=${PIPESTATUS[0]}
|
||||
set -e
|
||||
output="$(cat "$tmp_output")"
|
||||
rm -f "$tmp_output"
|
||||
printf '%s\n' "$output"
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue