Redirect STDERR to function to make errors prettier. Hopefully this actually works. Let me know if this fails miserably.

This commit is contained in:
Brett Bohnenkamper
2013-11-04 01:19:05 -06:00
parent 515719cb17
commit 39df6caa0c

View File

@@ -129,6 +129,9 @@ function verboseOut {
function errorOut {
printf "\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m$1\n"
}
function stderrOut {
while IFS='' read -r line; do printf "\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m${line}\n"; done
}
####################
@@ -3227,7 +3230,9 @@ for i in "${display[@]}"; do
else
if [[ "${display[*]}" =~ "$i" ]]; then
if [[ "$errorSuppress" == "1" ]]; then detect${i} 2>/dev/null
else detect${i}; fi
else
exec 3> >(stderrOut)
detect${i} 2>&3; fi
fi
fi
done