summaryrefslogtreecommitdiffhomepage
path: root/site.sh
diff options
context:
space:
mode:
Diffstat (limited to 'site.sh')
-rw-r--r--site.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/site.sh b/site.sh
index cc32ea4..b8f7833 100644
--- a/site.sh
+++ b/site.sh
@@ -13,10 +13,15 @@ mkdir -p site
for d in ${COMBINES}; do
name="${d##*/}"; name="${name%%.git}"
- if [ -d site/"${name}" ]; then
- git -C site/"${name}" pull
+ if git -C "${d}" rev-parse --git-dir >/dev/null 2>&1 \
+ && git -C "${d}" diff --exit-code >/dev/null 2>&1;then
+ if [ -d site/"${name}" ]; then
+ git -C site/"${name}" pull "${d}"
+ else
+ git clone --depth=1 "${d}" site/"${name}"
+ fi
else
- git clone --depth=1 "${d}" site/"${name}"
+ [ -e "${d}" ] && rsync -rua --del "${d}"/ site/"${name}"
fi
if ! [ -f site/"${name}"/config.mk ]; then