Files
gonic/_do_gen_assets
2020-04-01 17:59:44 +01:00

23 lines
535 B
Bash
Executable File

#!/bin/sh
# using sh, is run from alpine
embed_bin_path=/tmp/gonicembed
assets_path=server/assets
# only build once for some slightly faster live page reloading
if [[ ! -e "$embed_bin_path" ]]; then
go build \
-o "$embed_bin_path" \
cmd/gonicembed/main.go
fi
find $assets_path/ \
-type f \
! -name '*.go' \
-exec "$embed_bin_path" \
-out-path $assets_path/assets_gen.go \
-package-name assets \
-assets-var-name Bytes \
-asset-path-prefix $assets_path/ \
{} +