Forest_Client/Tool/BuildTool/collect_and_send_error.sh

28 lines
573 B
Bash
Raw Normal View History

2024-06-12 15:01:54 +08:00
#!/bin/bash
2024-07-31 16:37:34 +08:00
#Check if a filename is provided as an argument
2024-06-12 15:01:54 +08:00
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <filename>"
exit 1
fi
2024-07-31 16:37:34 +08:00
echo"$0"
2024-06-12 15:01:54 +08:00
# Get the filename from the command line argument
filename="$1"
2024-07-31 16:37:34 +08:00
exception=$(grep -A 12 "\[Build Exception\]:" "$filename")
2024-06-12 15:01:54 +08:00
# Use grep to search for lines containing the word "error"
2024-07-31 16:37:34 +08:00
error=$(grep "error" "$filename")
echo "exception: $exception"
echo "error: $error"
2024-06-12 15:01:54 +08:00
# Pass the result to another script
2024-07-31 16:37:34 +08:00
sh to_inner_wechat_robot.sh "$exception"
sh blame.sh "$exception"
sh to_inner_wechat_robot.sh "$error"
sh blame.sh "$error"