You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ "${NO_COLOR}" = "true" ] || [[ "${TERM:-}" != "xterm"* ]] || [ -t 1 ]; then
seems to be wrong really in at least 2 different ways.
It checks STDOUT to be connected to a terminal while logging happens on STDERR only.
It turns OFF colors if STDOUT is actually connected to a terminal.
I'm guessing here but a quick check seems to suggest that nobody noticed until now because __b3bp_log always got called in a subshell which actually was not connected to a terminal. If the function would be just called - as suggested by shellcheck - the code would not work as expected.
Now I can fix that, but before that I wanted to ask if there is something about this code, or the decisions leading to this code, which I overlooked or I don't understand.
The text was updated successfully, but these errors were encountered:
turn off colors if NO_COLOR is "true" or TERM is not "xterm*" or STDERR
is not connected to a terminal, but ignore TERM and STDERR if NO_COLOR
is set to "false" explicitly.
Fixes#69
bash3boilerplate/main.sh
Line 78 in 9b739b4
The line
seems to be wrong really in at least 2 different ways.
I'm guessing here but a quick check seems to suggest that nobody noticed until now because
__b3bp_log
always got called in a subshell which actually was not connected to a terminal. If the function would be just called - as suggested by shellcheck - the code would not work as expected.Now I can fix that, but before that I wanted to ask if there is something about this code, or the decisions leading to this code, which I overlooked or I don't understand.
The text was updated successfully, but these errors were encountered: