aboutsummaryrefslogtreecommitdiffstats
path: root/mirror.rc
diff options
context:
space:
mode:
Diffstat (limited to 'mirror.rc')
-rwxr-xr-xmirror.rc22
1 files changed, 22 insertions, 0 deletions
diff --git a/mirror.rc b/mirror.rc
new file mode 100755
index 0000000..8d1b106
--- /dev/null
+++ b/mirror.rc
@@ -0,0 +1,22 @@
+#!/bin/rc
+# Refresh the blog mirror in html/ and push it. Run from the repo root.
+rfork en
+
+if(! test -x ./blogmirror){
+ echo 'build first: mk' >[1=2]
+ exit 'nobinary'
+}
+
+git/fs >[2]/dev/null # harmless if already running
+
+./blogmirror -o html || exit 'mirror'
+
+files=`{walk -f html}
+if(~ $#files 0)
+ exit 'nothing mirrored'
+
+git/add $files
+if(git/commit -m 'mirror blog.sillylaird.ca' $files)
+ git/push
+if not
+ echo 'no changes' >[1=2]