diff --git a/script/test b/script/test index 90066137..a3fd3b6c 100755 --- a/script/test +++ b/script/test @@ -126,11 +126,20 @@ case ${mode} in function write_log_file { echo "" > log.html line_count=$(grep -n '^$' log.dot | tail -1 | cut -f1 -d:) - head -n $line_count log.dot | dot -Tsvg >> log.html - echo "Wrote log.html ($line_count lines)" + if [[ -n $line_count ]]; then + head -n $line_count log.dot | dot -Tsvg >> log.html + else + cat log.dot | dot -Tsvg >> log.html + fi + echo "Wrote log.html - $line_count" } - function handle_sigint { echo; write_log_file; } + function handle_sigint { + trap '' SIGINT + echo + write_log_file + exit 0 + } trap handle_sigint SIGINT $cmd "${args[@]}" 2> log.dot || export status=$?