File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
lib/bashly/libraries/colors Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 15
15
# # `src/initialize.sh` (Run `bashly add hooks` to add this file).
16
16
# #
17
17
enable_auto_colors () {
18
- [[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
18
+ # # If NO_COLOR has not been set and stdout is not a TTY, disable colors
19
+ if [[ -z ${NO_COLOR+x} && ! -t 1 ]]; then
20
+ NO_COLOR=1
21
+ fi
19
22
}
20
23
21
24
print_in_color () {
Original file line number Diff line number Diff line change 15
15
# # `src/initialize.sh` (Run `bashly add hooks` to add this file).
16
16
# #
17
17
enable_auto_colors () {
18
- [[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
18
+ # # If NO_COLOR has not been set and stdout is not a TTY, disable colors
19
+ if [[ -z ${NO_COLOR+x} && ! -t 1 ]]; then
20
+ NO_COLOR=1
21
+ fi
19
22
}
20
23
21
24
print_in_color () {
Original file line number Diff line number Diff line change 15
15
# # `src/initialize.sh` (Run `bashly add hooks` to add this file).
16
16
# #
17
17
enable_auto_colors () {
18
- [[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
18
+ # # If NO_COLOR has not been set and stdout is not a TTY, disable colors
19
+ if [[ -z ${NO_COLOR+x} && ! -t 1 ]]; then
20
+ NO_COLOR=1
21
+ fi
19
22
}
20
23
21
24
print_in_color () {
Original file line number Diff line number Diff line change 15
15
# # `src/initialize.sh` (Run `bashly add hooks` to add this file).
16
16
# #
17
17
enable_auto_colors () {
18
- [[ -z ${NO_COLOR+x} && ! -t 1 ]] && NO_COLOR=1 || true
18
+ # # If NO_COLOR has not been set and stdout is not a TTY, disable colors
19
+ if [[ -z ${NO_COLOR+x} && ! -t 1 ]]; then
20
+ NO_COLOR=1
21
+ fi
19
22
}
20
23
21
24
print_in_color () {
You can’t perform that action at this time.
0 commit comments