mirror of
				https://github.com/prometheus/prometheus.git
				synced 2025-10-31 08:21:16 +01:00 
			
		
		
		
	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
 |