From c1211b7e29bd80e5f7f378bedeb760ee679fcb1c Mon Sep 17 00:00:00 2001
From: Jean-Jacques Brucker <jeanjacquesbrucker@gmail.com>
Date: Fri, 6 Aug 2021 01:36:26 +0200
Subject: [PATCH] little script to be called from a cron

---
 update_from_git.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100755 update_from_git.sh

diff --git a/update_from_git.sh b/update_from_git.sh
new file mode 100755
index 0000000..0f8880b
--- /dev/null
+++ b/update_from_git.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Call this script with the -D or --buildDrafts to build also content marked as draft.
+# And put it on a cron to synchronize periodically
+
+cd $(dirname "$0")
+
+head="$(git rev-parse HEAD)"
+
+git stash
+git pull --rebase --recurse-submodules
+git stash pop
+
+[[ $(git rev-parse HEAD) == $head ]] || hugo "$@"
-- 
GitLab