Add reinstallation tool

This commit is contained in:
Ivan Bushchik 2022-07-05 08:26:29 +03:00
parent 9a3e34600f
commit eae87382dd
No known key found for this signature in database
GPG key ID: 3E4E9C7D66E44BF7
3 changed files with 20 additions and 1 deletions

View file

@ -45,4 +45,6 @@ if [[ $answer = [Yy] ]]; then
sh tools/git.sh sh tools/git.sh
fi fi
chmod +x $HOME/.dotfiles/tools/*
exec zsh exec zsh

12
tools/reinstall.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/sh
GREEN="\033[32m"
RED="\033[31m"
CLEAR_COLOR="\033[0m"
echo "${RED}Reinstalling dotfiles${CLEAR_COLOR}"
echo "To proceed press enter"
read A
rm -rf $HOME/.dotfiles
sh -c "$(curl -fsSL https://ivabus.dev/dotfiles)"

View file

@ -9,7 +9,12 @@ CLEAR_COLOR="\033[0m"
cd $HOME/.dotfiles cd $HOME/.dotfiles
echo "1) ${GREEN}Upgrading dotfiles$CLEAR_COLOR" echo "1) ${GREEN}Upgrading dotfiles$CLEAR_COLOR"
git pull > /dev/null 2>&1 if git pull > /dev/null 2>&1
then
echo "$HOME/.dotfiles synced"
else
echo "$HOME/.dotfiles couldn't be 'git pull'ed, check your connection to internet or run tools/reinstall.sh"
exit 1
sh tools/relink.sh sh tools/relink.sh
echo "2) ${GREEN}Upgrading oh-my-zsh$CLEAR_COLOR" echo "2) ${GREEN}Upgrading oh-my-zsh$CLEAR_COLOR"
zsh -c "source $ZSH/oh-my-zsh.sh && omz update" > /dev/null zsh -c "source $ZSH/oh-my-zsh.sh && omz update" > /dev/null