Summary Files Commits Branches @commit @diff @stats
path: root / generate-dev.sh
diff options
context:
space:
mode:
1 files changed, 23 insertions, 9 deletions
-rwxr-xr-xgenerate-dev.sh32
diff --git a/generate-dev.sh b/generate-dev.sh
index 0fa8593..0911fce 100755
--- a/generate-dev.sh
+++ b/generate-dev.sh
@@ -21,17 +21,31 @@ endTimer () {
printf "%.3fs $1\n" $dur
}
-startTimer
- find './awk-edits' -type f -name "[A-Z]*.awk" -exec cat {} + > /tmp/syndamiadotcom-awk
- find './awk-edits' -type f -name "_*.awk" -exec cat {} + >> /tmp/syndamiadotcom-awk
- find './awk-edits' -type f -name "[a-z]*.awk" -exec cat {} + >> /tmp/syndamiadotcom-awk
-endTimer "generation of /tmp/syndamiadotcom-awk"
+combine() {
+ startTimer
+ find './awk-edits' -type f -name "[A-Z]*.awk" -exec cat {} + > /tmp/syndamiadotcom-awk
+ find './awk-edits' -type f -name "_*.awk" -exec cat {} + >> /tmp/syndamiadotcom-awk
+ find './awk-edits' -type f -name "[a-z]*.awk" -exec cat {} + >> /tmp/syndamiadotcom-awk
+ endTimer "generation of /tmp/syndamiadotcom-awk"
-startTimer
- for file in $(find '/var/www/synd' -type f -name "*.html"); do
- awk -f '/tmp/syndamiadotcom-awk' "$file" > tmp && mv -f tmp "$file"
+ startTimer
+ for file in $(find '/var/www/synd' -type f -name "*.html"); do
+ awk -f '/tmp/syndamiadotcom-awk' "$file" > tmp && mv -f tmp "$file"
+ done
+ endTimer "/tmp/syndamiadotcom-awk"
+}
+
+separated() {
+ for i in $(find './awk-edits' -type f -name "[A-Z]*.awk") $(find './awk-edits' -type f -name "[a-z]*.awk"); do
+ startTimer
+ for file in $(find '/var/www/synd/' -type f -name "*.html"); do
+ awk -f "$i" -f './awk-edits/_print.awk' "$file" > tmp && mv -f tmp "$file"
+ done
+ endTimer "$i"
done
-endTimer "/tmp/syndamiadotcom-awk"
+}
+
+[ -n "$1" ] && separated || combine
#
# Tiny version