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";