2022-08-22 13:05:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
original_exit_code="${ret:-1}"
|
|
|
|
log_dir_path="${1:-logs}"
|
|
|
|
context="${2:-10}"
|
|
|
|
|
|
|
|
show_make_build_errors() {
|
2023-01-09 09:49:35 +00:00
|
|
|
grep -slr 'make\[[[:digit:]]\+\].*Error [[:digit:]]\+$' "$log_dir_path" | while IFS= read -r log_file; do
|
2022-08-22 13:05:01 +00:00
|
|
|
printf "====== Make errors from %s ======\n" "$log_file";
|
2023-01-09 09:49:35 +00:00
|
|
|
grep -r -C"$context" 'make\[[[:digit:]]\+\].*Error [[:digit:]]\+$' "$log_file" ;
|
2022-08-22 13:05:01 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
show_make_build_errors
|
|
|
|
exit "$original_exit_code"
|