X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=all.do;fp=all.do;h=edd2b476138f004700d16d19f9734d8116c56136;hb=58272f437f554daa14ac1dfdf9902d48c17841bf;hp=0000000000000000000000000000000000000000;hpb=41db49b35f4622e7caa7aecd9b814d8a760fc259;p=redo-blog diff --git a/all.do b/all.do new file mode 100644 index 0000000..edd2b47 --- /dev/null +++ b/all.do @@ -0,0 +1,41 @@ +#!/bin/sh + +# Remove target files for which no sources files can be found. +for file in *.intermediate; do + if test -f "$file" && + ! test -f "${file%.intermediate}.md" && + ! test -f "${file%.intermediate}.rst"; then + rm "$file" + fi +done +for file in *.uuid; do + if test -f "$file" && + ! test -f "${file%.uuid}.md" && + ! test -f "${file%.uuid}.rst"; then + rm "$file" + fi +done +for file in *.html; do + if test -f "$file" && + ! test "$file" = "index.html" && + ! test -f "${file%.html}.intermediate"; then + rm "$file" + fi +done + +# Determine target files from the sources files present, declare dependencies +# of the all.do script on them / build them if necessary. +for file in *.rst *.md; do + if test -f "$file"; then + redo-ifchange "${file%.*}.intermediate" + fi +done +for file in *.intermediate; do + if test -f "$file"; then + redo-ifchange "${file%.*}.html" + fi +done + +# Regenerate feed and index pages. Always. +redo "feed.xml" +redo "index.html"