pvincent 1 week ago
parent
commit
cdba7cc616
  1. 2
      bin/bash-back
  2. 8
      lib/utility.bash
  3. 4
      useless.sh

2
bin/bash-back

@ -78,6 +78,8 @@ function on_exit {
stack_summary+=("ERROR $code: [$message]") stack_summary+=("ERROR $code: [$message]")
fi fi
else else
# FIXME: should grab the whole stacktrace, then print back again,
# because previous stderr might disappear from the first script after calling subprocess!
regex="^ .*:[0-9]* .*\$" regex="^ .*:[0-9]* .*\$"
[[ "$last_error" =~ $regex ]] || stack_summary+=("ERROR $code: <undefined>") [[ "$last_error" =~ $regex ]] || stack_summary+=("ERROR $code: <undefined>")
fi fi

8
lib/utility.bash

@ -8,12 +8,12 @@ function blabla {
} }
function suite { function suite {
echo $nope
return
exit exit
return 7
exit 10 # youpi
command_not_found command_not_found
return
exit 10 # youpi
return 7
echo $nope
} }
blabla blabla

4
useless.sh

@ -31,10 +31,10 @@ function F3 {
echo start of useless echo start of useless
F3 F3
lib/utility.bash
>&2 echo some trace in stderr
. lib/utility.bash . lib/utility.bash
lib/utility.bash
# >&2 echo some trace in stderr
main main
# error # error
echo end of useless echo end of useless
Loading…
Cancel
Save