Skip to content

Commit

Permalink
fix: print colorful messages
Browse files Browse the repository at this point in the history
  • Loading branch information
YasminTeles committed Apr 6, 2024
1 parent 0103bec commit 0b3de2a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion brew/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ brew "pyenv"
cask "visual-studio-code"
cask "firefox-developer-edition"
cask "google-chrome"
cask "beekeeper-studio"
# cask "beekeeper-studio"
cask "figma"
cask "postman"

Expand Down
30 changes: 20 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@ set -e
TOTAL_STEPS=7
STEP=1
function step_msg {
printf "\n\033[36;1m[%s/%s] %s...\033[0m\n" "$STEP" "$TOTAL_STEPS" "$1";
printf "\033[36;1m[%s/%s] %s...\n\033[0m" "$STEP" "$TOTAL_STEPS" "$1";
((STEP++))
}

function title_msg {
printf "\n%s\n" "$1";
printf "\n\033[35;1m%s\n\n" "$1";
}

# -- Getting Started ----------------------------------------------------------
title_msg "This script will install your workspace."

echo "██████╗ ██████╗ ████████╗███████╗██╗██╗ ███████╗███████╗"
echo "██╔══██╗██╔═══██╗╚══██╔══╝██╔════╝██║██║ ██╔════╝██╔════╝"
echo "██║ ██║██║ ██║ ██║ █████╗ ██║██║ █████╗ ███████╗"
echo "██║ ██║██║ ██║ ██║ ██╔══╝ ██║██║ ██╔══╝ ╚════██║"
echo "██████╔╝╚██████╔╝ ██║ ██║ ██║███████╗███████╗███████║"
echo "╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝"

# -- Get some information -----------------------------------------------------
if [ "$CI" = true ] ; then
[email protected]
Expand All @@ -23,31 +33,31 @@ else
read -r -p "What is your email? " GIT_EMAIL
fi

title_msg "Please wait! It will configure your environment."
title_msg "Please wait! It will configure your workspace."

# -- Project folder -----------------------------------------------------------
step_msg "Creating the Projects folder"
mkdir ~/Projects

# -- Dependencies -------------------------------------------------------------
step_msg "Installing dependencies"
brew install git stow
brew install git stow 1> /dev/null

# -- Dotfiles -----------------------------------------------------------------
step_msg "Setting up dotfiles"
git clone https://github.com/YasminTeles/dotfiles.git ~/.dotfiles
git clone https://github.com/YasminTeles/dotfiles.git ~/.dotfiles 1> /dev/null

rm -rf ~/.gitconfig
cd ~/.dotfiles
stow --dotfiles git ssh brew

# -- Productivity Apps ---------------------------------------------------------
step_msg "Installing the productivity apps"
brew bundle install --file=~/Brewfile
brew bundle install --file=~/Brewfile 1> /dev/null

# -- Oh My Zsh -----------------------------------------------------------------
step_msg "Installing the Oh My Zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended 1> /dev/null
rm -rf ~/.zshrc
stow --dotfiles zsh
echo "My current shell is $SHELL."
Expand All @@ -59,7 +69,7 @@ git config --global user.email "$GIT_EMAIL"
# -- SSH Key -------------------------------------------------------------------
step_msg "Generating a new SSH key"
rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
ssh-keygen -t ed25519 -C "$GIT_EMAIL" -f ~/.ssh/id_ed25519 -q -N ""
ssh-keygen -t ed25519 -C "$GIT_EMAIL" -f ~/.ssh/id_ed25519 -q -N "" 1> /dev/null
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

Expand All @@ -70,5 +80,5 @@ echo -e "- Run \033[1mmake ssh\033[0m to copy your SSH public Key and past it in
echo -e "- Run \033[1mmake zsh\033[0m to change your shell to zsh mode."

# -- Happy end -----------------------------------------------------------------
printf "\n\nSuccess: Everything is ready!"
printf "\nHave a nice day!\n"
title_msg "Everything is ready!"
title_msg "Have a nice day!"
13 changes: 9 additions & 4 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ function step_msg {
((STEP++))
}

echo "This script will remove all configurations of the environment."
function title_msg {
printf "\n\033[35;1m%s\n\n" "$1";
}

# -- Getting Started ----------------------------------------------------------
title_msg "This script will remove your workspace."

if [ ! "$CI" ]
then
Expand All @@ -20,7 +25,7 @@ fi

if [[ "$CI" || "$CONFIRM" == [yY] || "$CONFIRM" == [yY][eE][sS] ]]
then
printf "\nPlease wait! Proceeding with the removal of all configurations...\n"
title_msg "Please wait! Proceeding to remove your workspace..."

# -- Symlinks ----------------------------------------------------------------
step_msg "Removing all symlinks"
Expand All @@ -45,11 +50,11 @@ then
rm -rf ~/.dotfiles

# -- Happy end -----------------------------------------------------------------
printf "\nAll configurations have been removed."
title_msg "The workspace have been removed."

else
printf "\nOperation cancelled."
fi

printf "\nHave a nice day!\n"
title_msg "Have a nice day!"

0 comments on commit 0b3de2a

Please sign in to comment.