2021-07-06 13:53:00 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
shopt -s dotglob extglob globstar
|
|
|
|
|
|
|
|
export PATH="$PWD/node_modules/.bin:$PATH"
|
|
|
|
|
2021-11-25 20:33:45 -05:00
|
|
|
rm -rf nginx-tmp
|
|
|
|
cp -a nginx nginx-tmp
|
|
|
|
|
2021-11-23 18:45:28 -05:00
|
|
|
rm -rf static-tmp
|
|
|
|
cp -a /usr/share/webapps/element static-tmp
|
|
|
|
cp --remove-destination webapps/element/config.json static-tmp/config.json
|
2021-07-06 13:53:00 -04:00
|
|
|
|
2021-12-10 05:53:33 -05:00
|
|
|
# work around https://bugs.archlinux.org/task/72968
|
|
|
|
find static-tmp -name '*.js' -exec sed -i 's/!!UNSET!!/1.9.6/' {} +
|
|
|
|
|
2021-07-21 17:19:03 -04:00
|
|
|
brotli_k() {
|
|
|
|
brotli -k "$@"
|
|
|
|
}
|
|
|
|
export -f brotli_k
|
|
|
|
|
2021-11-23 18:28:10 -05:00
|
|
|
zopfli_preserve_time() {
|
|
|
|
zopfli "$1"
|
|
|
|
touch -r "$1" "$1.gz"
|
|
|
|
}
|
|
|
|
export -f zopfli_preserve_time
|
|
|
|
|
2021-11-23 20:06:54 -05:00
|
|
|
find static-tmp -regex '.+\.\(css\|html\|ico\|js\|json\|map\|svg\|txt\|wasm\|xml\)' |
|
2021-11-23 18:28:10 -05:00
|
|
|
parallel -q ::: brotli_k zopfli_preserve_time :::: -
|