-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutils.sh
More file actions
55 lines (45 loc) · 1.12 KB
/
utils.sh
File metadata and controls
55 lines (45 loc) · 1.12 KB
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
52
53
54
55
printColor() {
local color=$1
local text=$2
case $color in
"green")
echo -e "\e[1m\e[32m${text}\e[0m" ;;
"red")
echo -e "\e[1m\e[31m${text}\e[0m" ;;
"blue")
echo -e "\e[1m\e[34m${text}\e[0m" ;;
"yellow")
echo -e "\e[1m\e[33m${text}\e[0m" ;;
"black")
echo -e "\e[1m\e[30m${text}\e[0m" ;;
*)
echo "Unsupported color" ;;
esac
}
function logo {
bash <(curl -s https://raw.githubusercontent.com/CPITMschool/Scripts/main/logo.sh)
}
function printLine {
echo "---------------------------------------------------------------------------------------"
}
function addToPath {
if ! echo "$PATH" | grep -q "${1}" ; then
echo "export PATH=\$PATH:${1}" >> $HOME/.bash_profile
source $HOME/.bash_profile
fi
}
function printAddition {
echo -e "\e[4m${1}\e[0m"
}
function printGreen {
echo -e "\e[1m\e[32m${1}\e[0m"
}
function printRed {
echo -e "\e[1m\e[31m${1}\e[0m"
}
function printBlue {
echo -e "\e[1m\e[34m${1}\e[0m"
}
function printYellow {
echo -e "\e[1m\e[33m${1}\e[0m"
}