Add support for native windows

This commit is contained in:
Manuel Thalmann 2023-03-30 01:48:11 +02:00
parent 30eb32adc3
commit dec2742902

View file

@ -216,13 +216,21 @@ then
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$") errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|Error\): [A-Z0-9]\+: .*\)$"); errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|Error\): [A-Z0-9]\+: .*\)$");
if [ ! -z "${USE_WINDOWS_PATHS}" ]
then
echo "Help me! I am forced to use windows paths, omgg!";
fixCommand="wslpath -m";
else
fixCommand="realpath";
fi;
for errorPattern in "${errorPatterns[@]}" for errorPattern in "${errorPatterns[@]}"
do do
sed -i \ sed -i \
-e "/$errorPattern/{" \ -e "/$errorPattern/{" \
-e "h;" \ -e "h;" \
-e "s/$errorPattern/\1\n\3/" \ -e "s/$errorPattern/\1\n\3/" \
-e "x; s/$errorPattern/realpath \"\2\"/" \ -e "x; s/$errorPattern/$fixCommand \"\2\"/" \
-e "e" \ -e "e" \
-e "x; G; h;" \ -e "x; G; h;" \
-e "s/\([^\n]*\)\n//" \ -e "s/\([^\n]*\)\n//" \