mirror of
https://github.com/KittyKatt/screenFetch.git
synced 2026-04-24 03:00:16 -04:00
Redirect STDERR to function to make errors prettier. Hopefully this actually works. Let me know if this fails miserably.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user