Skip to content

Commit 3318334

Browse files
mplsgrantwillcl-ark
authored andcommitted
add color
1 parent 8f49bd0 commit 3318334

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

resources/scripts/setup_minikube.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ if [ -z "${WAR_RPC+x}" ]; then
88
exit 1
99
fi
1010

11+
# Colors and styles
12+
RESET='\033[0m'
13+
BOLD='\033[1m'
14+
15+
# Use colors if we can and have the color space
16+
if command -v tput &> /dev/null; then
17+
ncolors=$(tput colors)
18+
if [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
19+
RESET=$(tput sgr0)
20+
BOLD=$(tput bold)
21+
fi
22+
fi
23+
24+
print_message() {
25+
local color="$1"
26+
local message="$2"
27+
local format="${3:-}"
28+
echo -e "${format}${color}${message}${RESET}"
29+
}
30+
31+
print_partial_message() {
32+
local pre_message="$1"
33+
local formatted_part="$2"
34+
local post_message="$3"
35+
local format="${4:-}" # Default to empty string if not provided
36+
local color="${5:-$RESET}"
37+
38+
echo -e "${color}${pre_message}${format}${formatted_part}${RESET}${color}${post_message}${RESET}"
39+
}
1140
# Check minikube status
1241
minikube delete
1342

0 commit comments

Comments
 (0)