diff --git a/bootstrap.sh b/bootstrap.sh index 33ea087..a3bf1d5 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -30,3 +30,13 @@ link "$HOME" ".gitconfig" "gitconfig" # Configure .zshrc link "$HOME" ".zshrc" "zshrc" + +# Create an auto updater for the dotfiles +if [ ! -f "$HOME/.update_dotfiles.sh" ]; then + echo "#!/usr/bin/env sh" > $HOME/.update_dotfiles.sh + echo "echo 'Updating dotfiles'" >> $HOME/.update_dotfiles.sh + echo "cd $PWD" >> $HOME/.update_dotfiles.sh + echo "git checkout master" >> $HOME/.update_dotfiles.sh + echo "git pull" >> $HOME/.update_dotfiles.sh + chmod +x $HOME/.update_dotfiles.sh +fi diff --git a/zshrc b/zshrc index a0c97a5..f2597b8 100644 --- a/zshrc +++ b/zshrc @@ -26,3 +26,7 @@ export EDITOR='vim' # Don't use the embedded shell time. Use GNU time. alias time="/usr/bin/time" + +if [ -f "$HOME/.update_dotfiles.sh" ]; then + /usr/bin/env sh $HOME/.update_dotfiles.sh +fi