From c6c642a4272f3f59670d3696a20903d3be34986f Mon Sep 17 00:00:00 2001 From: Drew Short Date: Wed, 9 Sep 2015 21:44:22 -0500 Subject: [PATCH] Rolling in an auto updater to the zshrc and the bootstrap script. --- bootstrap.sh | 10 ++++++++++ zshrc | 4 ++++ 2 files changed, 14 insertions(+) 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