summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-09-25 14:42:59 -0400
committerFreya Murphy <freya@freyacat.org>2024-09-25 14:42:59 -0400
commita8b7f0d0db2aa64efb6d176de321402d1f5e5bdb (patch)
tree723798498c591076092e825d4b5ddee825cf252b /build
parentupdate website min width, fix pre elements expanding too far (diff)
downloadwebsite-a8b7f0d0db2aa64efb6d176de321402d1f5e5bdb.tar.gz
website-a8b7f0d0db2aa64efb6d176de321402d1f5e5bdb.tar.bz2
website-a8b7f0d0db2aa64efb6d176de321402d1f5e5bdb.zip
generate array of file time stamps for production
Diffstat (limited to 'build')
-rwxr-xr-xbuild/stamp.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/build/stamp.sh b/build/stamp.sh
new file mode 100755
index 0000000..3b19b04
--- /dev/null
+++ b/build/stamp.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+out="./src/web/stamp.php"
+public="./src/public"
+files=$(find "$public" -type f -printf %P\\n)
+
+printf "<?php\n\$__stamps = array();\n" > "$out"
+for file in $files; do
+ stamp=$(date +%s -r "$public/$file")
+ echo "\$__stamps['public/$file'] = $stamp;" >> "$out";
+done
+echo "define('FILE_TIMES', \$__stamps);" >> "$out"
+echo "unset(\$__stamps);" >> "$out"
+