-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eafcae7
commit 9886e77
Showing
4 changed files
with
86 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# Tells the shell script to exit if it encounters an error | ||
set -e | ||
|
||
# Print a step description | ||
TOTAL_STEPS=5 | ||
STEP=1 | ||
function step_msg { | ||
printf "\n\033[36;1m[%s/%s] %s...\033[0m\n" "$STEP" "$TOTAL_STEPS" "$1"; | ||
((STEP++)) | ||
} | ||
|
||
echo "This script will remove all configurations of the environment." | ||
|
||
if [ "$CI" == true ] | ||
then | ||
read -r -p "Are you sure you want to proceed? (y/n) " CONFIRM | ||
fi | ||
|
||
if [[ "$CI" || "$CONFIRM" == [yY] || "$CONFIRM" == [yY][eE][sS] ]] | ||
then | ||
printf "\nPlease wait! Proceeding with the removal of all configurations...\n" | ||
|
||
# -- Symlinks ---------------------------------------------------------------- | ||
step_msg "Removing all symlinks" | ||
cd ~/.dotfiles && stow --dotfiles -D git ssh brew zsh | ||
|
||
# -- Project folder ---------------------------------------------------------- | ||
step_msg "Removing the Project directory" | ||
rm -rf ~/Projects | ||
|
||
# -- SSH Key ----------------------------------------------------------------- | ||
step_msg "Removing SSH Keys" | ||
rm -rf ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub | ||
|
||
# -- Productivity Apps ------------------------------------------------------- | ||
step_msg "Removing all productivity apps" | ||
brew uninstall --force "$(brew list)" | ||
|
||
# -- Dotfiles ---------------------------------------------------------------- | ||
step_msg "Removing Dotfiles directory" | ||
rm -rf ~/.dotfiles | ||
|
||
# -- Happy end ----------------------------------------------------------------- | ||
printf "\nAll configurations have been removed." | ||
|
||
else | ||
printf "\nOperation cancelled." | ||
fi | ||
|
||
printf "\nHave a nice day!\n" | ||
|