aboutsummaryrefslogtreecommitdiffstats
path: root/mirror.rc
blob: 8d1b106c4f17af0fa5b774d632074b8456be7f78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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]