hakurei.app/validate_static
Danny Lin dff5a750d1 Switch to new bundled fastboot.js
This simplifies cache busting greatly without needing to do further
processing on any fastboot.js code before deploying. It also removes the
need for a non-module script with global scope.
2021-01-23 23:08:12 -05:00

20 lines
556 B
Bash
Executable File

#!/bin/bash
set -o errexit -o nounset -o pipefail
shopt -s dotglob extglob globstar
export PATH="$PWD/node_modules/.bin:$PATH"
rm -rf static_tmp
cp -a static static_tmp
rm -rf static_tmp/js/fastboot/{.git,demo,README.md}
for file in static_tmp/**/*.@(json|webmanifest); do
json_verify < "$file" >/dev/null
done
xmllint --noout static_tmp/**/*.@(html|svg|xml)
eslint static_tmp/**/!(fastboot.min|z-worker-pako|pako_inflate.min).js
stylelint static_tmp/**/*.css
validatornu --Werror --also-check-css --also-check-svg static_tmp/**/*.@(css|html|svg)