Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitdfb25c2adc8ea2e95a55cb448a4d76f653355c21 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-03-03 20:03:26 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-03-03 20:03:26 +0200
Files6b220a9d5dfaa0fe92ed8c947b8b61505c69632b
syndamia.com-dfb25c2adc8ea2e95a55cb448a4d76f653355c21.tar
syndamia.com-dfb25c2adc8ea2e95a55cb448a4d76f653355c21.tar.gz
syndamia.com-dfb25c2adc8ea2e95a55cb448a4d76f653355c21.zip
Parent7816d30c7078270054f6602fa40d62564b534d6f (diff)
[generate-dev] Added an option to run all awk script individually
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