File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 5
5
6
6
# os::text::reset resets the terminal output to default if it is called in a TTY
7
7
function os::text::reset() {
8
- if [ -t 1 ]; then
8
+ if [[ -t 1 ] ]; then
9
9
tput sgr0
10
10
fi
11
11
}
12
12
13
13
# os::text::bold sets the terminal output to bold text if it is called in a TTY
14
14
function os::text::bold() {
15
- if [ -t 1 ]; then
15
+ if [[ -t 1 ] ]; then
16
16
tput bold
17
17
fi
18
18
}
19
19
20
20
# os::text::red sets the terminal output to red text if it is called in a TTY
21
21
function os::text::red() {
22
- if [ -t 1 ]; then
22
+ if [[ -t 1 ] ]; then
23
23
tput setaf 1
24
24
fi
25
25
}
26
26
27
27
# os::text::green sets the terminal output to green text if it is called in a TTY
28
28
function os::text::green() {
29
- if [ -t 1 ]; then
29
+ if [[ -t 1 ] ]; then
30
30
tput setaf 2
31
31
fi
32
32
}
33
33
34
34
# os::text::blue sets the terminal output to blue text if it is called in a TTY
35
35
function os::text::blue() {
36
- if [ -t 1 ]; then
36
+ if [[ -t 1 ] ]; then
37
37
tput setaf 4
38
38
fi
39
39
}
40
40
41
41
# os::text::yellow sets the terminal output to yellow text if it is called in a TTY
42
42
function os::text::yellow() {
43
- if [ -t 1 ]; then
43
+ if [[ -t 1 ] ]; then
44
44
tput setaf 11
45
45
fi
46
46
}
@@ -49,7 +49,7 @@ function os::text::yellow() {
49
49
# terminal and leaves the cursor on that line to allow for overwriting that text
50
50
# if it is called in a TTY
51
51
function os::text::clear_last_line() {
52
- if [ -t 1 ]; then
52
+ if [[ -t 1 ] ]; then
53
53
tput cuu 1
54
54
tput el
55
55
fi
You can’t perform that action at this time.
0 commit comments