Extract Alpine.js in script/test so the pre-commit hook works
check / check (push) Successful in 3m15s
check / check (push) Successful in 3m15s
The extraction moves from the Makefile's assets target into script/assets. script/test runs it before the tests, so make test, make check, script/check and the pre-commit hook all get the file on a fresh clone; make assets, make build and make dev call the same script. The README now says only that nothing downloads Alpine.js. Model: opus-5-5
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# script/assets: extract Alpine.js from its npm package tarball, committed
|
||||
# in 3p/, to static/js/alpine.min.js, where go:embed reads it. The
|
||||
# extracted file is not committed. script/test, make build and make dev run
|
||||
# this first.
|
||||
set -eu
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
tar -xzOf 3p/alpinejs-3.14.9.tgz package/dist/cdn.min.js \
|
||||
>static/js/alpine.min.js
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user