mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
c901ebaf8d
This change makes sure that the git worktree is not changed while compressing assets, making it better for local development. To achieve this, the compression script keeps the un-compressed assets and generates the go:embed directory when compressing the files. A .gitignore file has been added to ignore generated files. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
12 lines
295 B
Bash
Executable file
12 lines
295 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# compress static assets
|
|
|
|
set -euo pipefail
|
|
|
|
cd web/ui
|
|
cp embed.go.tmpl embed.go
|
|
find static -type f -name '*.gz' -delete
|
|
find static -type f -exec gzip -fk '{}' \; -print0 | xargs -0 -I % echo %.gz | xargs echo //go:embed >> embed.go
|
|
echo var EmbedFS embed.FS >> embed.go
|