Files
gonic/_do_gen_assets
2020-03-22 01:11:48 +00:00

22 lines
503 B
Bash
Executable File

#!/bin/sh
embed_bin_path=/tmp/gonicembed
assets_path=server/assets
# only build once for some slightly faster live page reloading
if ! test -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/ \
{} +