-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·39 lines (29 loc) · 1 KB
/
generate.sh
File metadata and controls
executable file
·39 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# after you have made your edits run this script
# do the stats on README.md
./stats.sh
files=$(git ls-files -m)
num=$(git ls-files -m | wc -l)
git add -A -v
if [ ${#files} -le 50 ]; then
# git commit -m "Updating ${files}"
git commit -m "`echo Updating ${files}`"
else
git commit -m "Updating ${num} files"
fi
git push
# check if hugo is running
if `ps xu | grep -v grep | grep hugo > /dev/null` ; then
echo Hugo is running as a server. Kill the Hugo server then run hugo.
exit 1
fi
# Our chosen website generation tool Hugo (genuflect) does not recognise
# symlinks (at least it follows them sometimes) and so hugo server --watch
# does not update when README.md is changed. But we can't have the symlink
# going the other way, because that complicates working with the repository
# on GitHub (genuflect). So touch a file we don't care about, tricking
# stupid Hugo.
touch content/.gitkeep
# Trouble with hugo version numbers.
# Decide which hugo to run outside the script.
# hugo
echo hugo has not been run