Forest_Client/Tool/BuildTool/collect_and_send_error.sh

28 lines
573 B
Bash

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