Summary Files Commits Branches @commit @diff @stats
path: root / generate-dev.sh
diff options
context:
space:
mode:
1 files changed, 17 insertions, 8 deletions
-rwxr-xr-xgenerate-dev.sh25
diff --git a/generate-dev.sh b/generate-dev.sh
index 1e1c2ed..0fa8593 100755
--- a/generate-dev.sh
+++ b/generate-dev.sh
@@ -12,17 +12,26 @@ rm -f /var/www/synd/.files
# Generate files
ssg src /var/www/synd/ "Syndamia" "https://syndamia.com" > /dev/null
-allnormfiles=$(find '/var/www/synd' -type f -name "*.html")
dur=0
-
-for script in $(find "./generate-hooks" -type f -name "*.awk"); do
+startTimer () {
dur="$(date +%s%N)"
- for file in $allnormfiles; do
- awk -f "$script" "$file" > tmp && mv -f tmp "$file"
- done
+}
+endTimer () {
dur="$(echo "scale=4 ; ($(date +%s%N) - $dur) / 1000000000" | bc -l)"
- printf "%.3fs $script\n" $dur
-done
+ 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"
+
+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"
#
# Tiny version