Skip to content

Commit

Permalink
test,cram: print test messages prior to the execution of commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaipe committed Oct 17, 2020
1 parent 8d67c22 commit 87e3bae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/cram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ if [ -f "$what" -a -x "$what" ]; then

# reset environment, and define sensible defaults
env -i PATH="$PATH" LC_ALL=C TERM=dumb CRAM_PATH=$(dirname $0) \
gawk <"$what" >"$what".err '
gawk -v what="$what" <"$what" >"$what".err '
match($0, /^([[:space:]]+)\$(.*)$/, m) {
print $0
while ( ( "(" m[2] ") 2>&1 || echo [$?]" | getline ln ) > 0 ) {
while ( ( "(" m[2] "\n) 2>&1 || echo [$?]" | getline ln ) > 0 ) {
print m[1] ln
}
}
/^([^[:space:]].*|)$/ {
/^([^[:space:]].*)$/ {
print $0
print $0 | "cat 1>&2"
}
/^$/ {
print $0
}
'
Expand Down

0 comments on commit 87e3bae

Please sign in to comment.