X-Git-Url: https://plomlompom.com/repos/?p=redo-blog;a=blobdiff_plain;f=processor%2Fall.do;h=73d01249d653473fcc5eb760364aec696fff6b46;hp=edd2b476138f004700d16d19f9734d8116c56136;hb=6ee5e0e20b722b1d4e72dfa52a19ec684cb30410;hpb=4373137de8ac6ad8731e6828a9876de9efe0a82e diff --git a/processor/all.do b/processor/all.do index edd2b47..73d0124 100644 --- a/processor/all.do +++ b/processor/all.do @@ -1,24 +1,28 @@ #!/bin/sh +metadata_dir=.meta + # Remove target files for which no sources files can be found. -for file in *.intermediate; do +for file in "$metadata_dir"/*.intermediate; do + basename=$(basename "$file") if test -f "$file" && - ! test -f "${file%.intermediate}.md" && - ! test -f "${file%.intermediate}.rst"; then + ! test -f "${basename%.intermediate}.md" && + ! test -f "${basename%.intermediate}.rst"; then rm "$file" fi done -for file in *.uuid; do +for file in "$metadata_dir"/*.uuid; do + basename=$(basename "$file") if test -f "$file" && - ! test -f "${file%.uuid}.md" && - ! test -f "${file%.uuid}.rst"; then + ! test -f "${basename%.uuid}.md" && + ! test -f "${basename%.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 + ! test -f "${metadata_dir}/${file%.html}.intermediate"; then rm "$file" fi done @@ -27,12 +31,13 @@ done # 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" + redo-ifchange "${metadata_dir}/${file%.*}.intermediate" fi done -for file in *.intermediate; do +for file in "$metadata_dir"/*.intermediate; do if test -f "$file"; then - redo-ifchange "${file%.*}.html" + basename=$(basename "$file") + redo-ifchange "${basename%.intermediate}.html" fi done