From ead4511250deb877e1867c2e38cbee9c27deb299 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 16 Jul 2018 22:25:50 +0200 Subject: add the infrastructure for an embedded web UI + command --- pack_webui.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pack_webui.go (limited to 'pack_webui.go') diff --git a/pack_webui.go b/pack_webui.go new file mode 100644 index 00000000..845b150b --- /dev/null +++ b/pack_webui.go @@ -0,0 +1,29 @@ +// +build ignore + +package main + +import ( + "log" + "net/http" + "os" + "path/filepath" + + "github.com/shurcooL/vfsgen" +) + +func main() { + var cwd, _ = os.Getwd() + + webUIAssets := http.Dir(filepath.Join(cwd, "webui/build")) + + err := vfsgen.Generate(webUIAssets, vfsgen.Options{ + Filename: "webui/packed_assets.go", + PackageName: "webui", + BuildTags: "deploy_build", + VariableName: "WebUIAssets", + }) + + if err != nil { + log.Fatalln(err) + } +} -- cgit