home · contact · privacy
Add dependencies list to README.
[redo-blog] / all.do
1 #!/bin/sh
2
3 # Remove target files for which no sources files can be found.
4 for file in *.intermediate; do
5   if   test -f "$file" &&
6      ! test -f "${file%.intermediate}.md" &&
7      ! test -f "${file%.intermediate}.rst"; then
8     rm "$file"
9   fi
10 done
11 for file in *.uuid; do
12   if   test -f "$file" &&
13      ! test -f "${file%.uuid}.md" &&
14      ! test -f "${file%.uuid}.rst"; then
15     rm "$file"
16   fi
17 done
18 for file in *.html; do
19   if   test -f "$file" &&
20      ! test "$file" = "index.html" &&
21      ! test -f "${file%.html}.intermediate"; then
22     rm "$file"
23   fi
24 done
25
26 # Determine target files from the sources files present, declare dependencies
27 # of the all.do script on them / build them if necessary.
28 for file in *.rst *.md; do
29   if test -f "$file"; then
30     redo-ifchange "${file%.*}.intermediate"
31   fi
32 done
33 for file in *.intermediate; do
34   if test -f "$file"; then
35     redo-ifchange "${file%.*}.html"
36   fi
37 done
38
39 # Regenerate feed and index pages. Always.
40 redo "feed.xml"
41 redo "index.html"