Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuninoto committed Oct 21, 2022
1 parent 7bf920f commit a97c2aa
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions installette.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# ANSI COLOR CODES
CYAN='\033[0;36m'
BLUE='\033[1;34m'
RED='\033[0;31m'
GREEN='\033[0;32m'
WHITE='\033[0;37m'
Expand Down Expand Up @@ -33,14 +34,16 @@ for arg in "$@"
do
case "$arg" in
"-v" | "--vim"*)
echo -e "${BLUE}VIM${RESET}"
if [ -x "$(command -v vim)" ]; then
echo -e "${CYAN}Vim is already installed.${RESET}"
echo -e "${CYAN}vim is already installed. Skipping...${RESET}"
else
echo "${CYAN}Installing Vim...${RESET}"
sudo apt-get install vim
fi;;

"-h" | "--header"*)
echo -e "${BLUE}42 HEADER${RESET}"
if [ -x "$(command -v vim)" ]; then
echo -e -n "${CYAN}Please insert your 42username${RESET}: "
read -r FT_User
Expand All @@ -59,9 +62,10 @@ do
echo -e "${CYAN}Run installette with the -v or --vim option${RESET}"
fi;;

"-n" | "--norminette"*)
"-n" | "--norminette"*)
echo -e "${BLUE}NORMINETTE${RESET}"
if [ -x "$(command -v norminette)" ]; then
echo -e "${CYAN}Norminette is already installed.${RESET}"
echo -e "${CYAN}Norminette is already installed. Skipping...${RESET}"
else
echo -e "${CYAN}Installing Norminette...${RESET}"
python3 -m pip install --upgrade pip setuptools
Expand All @@ -70,16 +74,19 @@ do
echo "export PATH=$PATH: /home/$(whoami)/.local/bin/" >> ~/.bashrc
fi;;

"-f" | "--formatter"*)
"-f" | "--formatter"*)
echo -e "${BLUE}FORMATTER${RESET}"
if [ -x "$(command -v c_formatter_42)" ]; then
echo -e "${CYAN}c-formatter-42 is already installed.${RESET}"
echo -e "${CYAN}c-formatter-42 is already installed. Skipping...${RESET}"
else
echo -e "${CYAN}Installing c_formatter_42...${RESET}"
pip3 install c-formatter-42
pip3 install --user c-formatter-42
fi;;

"-u" | "--uninstall"*)
echo -e "${BLUE}UNISTALL${RESET}"
#sed's -i option edits files in place
sed -i '/^USER/d' ~/.bashrc
echo -e "${CYAN}Unistalling 42Header...${RESET}"
sed -i '/^MAIL/d' ~/.bashrc
Expand All @@ -90,6 +97,6 @@ do
esac
done

echo -e "\n${GREEN}Installette terminated.${WHITE}"
echo -e "\n${GREEN}Installette terminated!${WHITE}"
echo -e "Thanks for using Installette =)"
echo -e "Yours truly, ${CYAN}Nuno Carvalho (Kuninoto)\n${WHITE}nnuno-ca@42porto.student.com${RESET}"

0 comments on commit a97c2aa

Please sign in to comment.