dotfiles/tools/upgrade.sh
2022-08-03 13:27:15 +03:00

27 lines
No EOL
633 B
Bash
Executable file

#!/bin/sh
# Dotfiles upgrade script that just pulls new dotfiles from repo
# oh-my-zsh update included!
CURRENTDIR="$(pwd)"
GREEN="\033[32m"
CLEAR_COLOR="\033[0m"
cd $HOME/.dotfiles
echo "1) ${GREEN}Upgrading dotfiles$CLEAR_COLOR"
# ignore local changes
git reset --hard HEAD > /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
fi
sh tools/relink.sh
echo "2) ${GREEN}Upgrading oh-my-zsh$CLEAR_COLOR"
zsh -c "source $ZSH/oh-my-zsh.sh && omz update" > /dev/null
cd $CURRENTDIR