This repository was archived by the owner on Jun 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·75 lines (71 loc) · 2.17 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·75 lines (71 loc) · 2.17 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
puts() {
# Num Colour #define R G B
# 0 black COLOR_BLACK 0,0,0
# 1 red COLOR_RED 1,0,0
# 2 green COLOR_GREEN 0,1,0
# 3 yellow COLOR_YELLOW 1,1,0
# 4 blue COLOR_BLUE 0,0,1
# 5 magenta COLOR_MAGENTA 1,0,1
# 6 cyan COLOR_CYAN 0,1,1
# 7 white COLOR_WHITE 1,1,1
text=$1
case $2 in
"black"|"BLACK")
output_color=0
;;
"red"|"RED")
output_color=1
;;
"green"|"GREEN")
output_color=2
;;
"yellow"|"YELLOW")
output_color=3
;;
"blue"|"BLUE")
output_color=4
;;
"magenta"|"MAGENTA")
output_color=5
;;
"cyan"|"CYAN")
output_color=6
;;
"white"|"WHITE")
output_color=7
;;
esac
if [ -z "$output_color" ]; then
echo "$text"
else
echo "$(tput setaf $output_color)$text $(tput sgr 0)"
fi
unset output_color
}
puts "Cloning repositorie..."
git clone git@github.com:dgamboaestrada/jefe.git -b master ~/.jefe-cli/
chmod +x ~/.jefe-cli/jefe-cli.sh
chmod +x ~/.jefe-cli/install.sh
chmod +x ~/.jefe-cli/uninstall.sh
puts "Done." GREEN
# Set jefe alias in .zshrc file
if [ -f ~/.zshrc ]; then
puts "Setting zsh configuration..."
sed -i "/# ----- Begin jefe-cli -----/,/# ----- End jefe-cli -----/ d" ~/.zshrc
echo "# ----- Begin jefe-cli -----" >> ~/.zshrc
echo "alias jefe=~/.jefe-cli/jefe-cli.sh" >> ~/.zshrc
echo "# ----- End jefe-cli -----" >> ~/.zshrc
puts "Done." GREEN
fi
# Set jefe alias in .zshrc file
if [ -f ~/.bashrc ]; then
puts "Setting bash configuration..."
sed -i "/# ----- Begin jefe-cli -----/,/# ----- End jefe-cli -----/ d" ~/.bashrc
echo "# ----- Begin jefe-cli -----" >> ~/.bashrc
echo "alias jefe=~/.jefe-cli/jefe-cli.sh" >> ~/.bashrc
echo "# ----- End jefe-cli -----" >> ~/.bashrc
puts "Done." GREEN
fi
puts "JEFE-CLI was installed successfully!!!" GREEN
puts "Reload your configuration .zshrc('\$source ~/.zshrc') or .bashrc('\$source ~/.bashrc')" YELLOW