From 2f9b0d2a8bb8e4f31613a35cbbb6c35d0e7b9f75 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 24 Mar 2023 00:03:38 +0000 Subject: [PATCH] Add support for `armclang` errors --- compile.sh | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/compile.sh b/compile.sh index 79281ba..3f012f9 100755 --- a/compile.sh +++ b/compile.sh @@ -212,15 +212,26 @@ then xvfb-run bash -c "dwm & wine \"C:\Keil_v5\UV4\UV4.exe\" -j0 -b \"$projectFile\" -t \"$targetName\" -l \"$logFile\"" > /dev/null 2>&1; mv -f "$tempFile" "$projectFile"; - errorPattern="\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$"; + errorPatterns=() + errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$") + errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|Error\): [A-Z0-9]\+: .*\)$"); - sed -i \ - -e "/$errorPattern/{" \ - -e "h; s/$errorPattern/realpath \"\1\"/;" \ - -e "x; s/$errorPattern/\2/; x;" \ - -e "e" \ - -e "G; s/\n//;" \ - -e "}" "$logFile"; + for errorPattern in "${errorPatterns[@]}" + do + echo "$errorPattern"; + sed -i \ + -e "/$errorPattern/{" \ + -e "h;" \ + -e "s/$errorPattern/\1\n\3/" \ + -e "x; s/$errorPattern/realpath \"\2\"/" \ + -e "e" \ + -e "x; G; h;" \ + -e "s/\([^\n]*\)\n//" \ + -e "s/\([^\n]*\)\n\(.*\)/\2\1/" \ + -e "x; s/\([^\n]*\)\n\(.*\)$/\1/" \ + -e "G; s/\n//" \ + -e "}" "$logFile"; + done; cat "$logFile";