-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshellUtils.sh
More file actions
executable file
·51 lines (40 loc) · 920 Bytes
/
shellUtils.sh
File metadata and controls
executable file
·51 lines (40 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Check if GREEN has already been defined
if [ -z "${GREEN+x}" ]; then
readonly GREEN=$'\e[1;32m'
fi
# Check if YELLOW has already been defined
if [ -z "${YELLOW+x}" ]; then
readonly YELLOW=$'\e[1;33m'
fi
# Check if RED has already been defined
if [ -z "${RED+x}" ]; then
readonly RED=$'\e[1;31m'
fi
# Check if BLUE has already been defined
if [ -z "${BLUE+x}" ]; then
readonly BLUE=$'\e[1;34m'
fi
# Check if TITLE has already been defined
if [ -z "${TITLE+x}" ]; then
readonly TITLE=$'\e[1;4;34m'
fi
# Check if RESET has already been defined
if [ -z "${RESET+x}" ]; then
readonly RESET=$'\e[0m'
fi
function success() {
echo "🎉 $GREEN$1$RESET"
}
function warning() {
echo "⚠️ $YELLOW$1$RESET"
}
function error() {
echo "💥 $RED$1$RESET"
}
function info() {
echo "$BLUE$1$RESET"
}
function title() {
printf "\n%s%s%s\n" "$TITLE" "$1" "$RESET"
}