Make run stream the output

This commit is contained in:
Sven van Heugten 2026-03-11 22:46:10 +01:00
parent 69f8acad8f
commit 3dc9930dbb
No known key found for this signature in database
GPG key ID: D612F88666F4F660
3 changed files with 9 additions and 2 deletions

View file

@ -27,9 +27,12 @@ set -euo pipefail
# helper functions inspired by bats/bats-assert # helper functions inspired by bats/bats-assert
run() { run() {
set +e set +e
output="$("$@" 2>&1)" tmp_output="$(mktemp)"
status=$? "$@" 2>&1 | tee "$tmp_output"
status=${PIPESTATUS[0]}
set -e set -e
output="$(cat "$tmp_output")"
rm -f "$tmp_output"
printf '%s\n' "$output" printf '%s\n' "$output"
return 0 return 0
} }

View file

@ -10,6 +10,7 @@
resholve, resholve,
shfmt, shfmt,
perl, perl,
coreutils,
}: }:
let let
@ -42,6 +43,7 @@ resholve.mkDerivation {
gitMinimal gitMinimal
shfmt shfmt
perl perl
coreutils
]; ];
checkPhase = '' checkPhase = ''
@ -69,6 +71,7 @@ resholve.mkDerivation {
gnused gnused
bash bash
perl perl
coreutils
]; ];
execer = [ execer = [
# Not true at all, but ¯\_(ツ)_/¯ # Not true at all, but ¯\_(ツ)_/¯

View file

@ -24,6 +24,7 @@
])) ]))
pkgs.perl pkgs.perl
pkgs.shfmt pkgs.shfmt
pkgs.coreutils
]; ];
}; };
} }