@@ -5,30 +5,29 @@ sleep 1
55echo " Updating repositories.."
66sudo apt update
77
8- tools_to_install=( git vim tmux htop sed zsh glances nmap screen i3lock-fancy) ;
9- # tools_to_install=(zsh);
8+ tools_requirements=(sudo git sed make wget curl)
9+ tools_to_install=(vim tmux htop zsh nmap screen i3lock-fancy glances );
1010plugins_zsh=(git docker npm python sudo systemd web-search)
1111
12- echo " Total tools: ${# tools_to_install[@]} " ;
1312
1413function echo_fail {
1514 # echo first argument in red
16- echo " \e[31m✘ ${1} No Installed"
15+ printf " \e[31m✘ ${1} No Installed"
1716 # reset colours back to normal
18- echo -e " \033[0m \n"
17+ printf " \033[0m \n"
1918}
2019
2120# display a message in green with a tick by it
2221# example
2322# echo echo_fail "Yes"
2423function echo_pass {
2524 # echo first argument in green
26- echo " \e[32m✔ ${1} Installed"
25+ printf " \e[32m✔ ${1} Installed"
2726 # reset colours back to normal
28- echo -e " \033[0m \n"
27+ printf " \033[0m \n"
2928}
3029
31- check_tool (){
30+ check_tool_and_install (){
3231 if type " $1 " & > /dev/null; then
3332 echo_pass $1
3433 else
@@ -62,7 +61,7 @@ install_lock(){
6261
6362install_oh_my_zsh (){
6463 sh -c " $( curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh) "
65- source ~ /.zshrc
64+ source ~ /.zshrc | zsh
6665 add_plugins_oh_my_zsh
6766}
6867
@@ -77,7 +76,20 @@ add_plugins_oh_my_zsh(){
7776 sed -i " s/ git/ $name_plugins /g" " $ruta "
7877}
7978
79+
80+ install_requirements (){
81+ echo " Install Requirements\n"
82+ for tool in ${tools_requirements[*]}
83+ do
84+ check_tool_and_install $tool
85+ done
86+ }
87+
88+ install_requirements
89+
90+ echo " Total tools: ${# tools_to_install[@]} \n" ;
91+
8092for tool in ${tools_to_install[*]}
8193do
82- check_tool $tool
94+ check_tool_and_install $tool
8395done
0 commit comments