From 3b1afd08ecd9629bab2d295ca2bfc5e2d4b41fd3 Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Mon, 23 Dec 2019 19:09:21 -0500 Subject: [PATCH] Self updating --- scripts/install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 17dc1bb..9865eff 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -76,5 +76,18 @@ function dotfiles { done } +# Check dotfiles for updates +function update { + echo Checking for dotfile updates + startTime=$(date +%s -r $dotdir) + cd $dotdir && git pull + endTime=$(date +%s -r $dotdir) + if (( "$startTime" < "$endTime" )); then + sh $dotdir/scripts/install.sh + exit + fi +} + +update dotfiles emacs