aboutsummaryrefslogtreecommitdiffstats
path: root/webui/pack_webui.go
diff options
context:
space:
mode:
Diffstat (limited to 'webui/pack_webui.go')
-rw-r--r--webui/pack_webui.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/webui/pack_webui.go b/webui/pack_webui.go
new file mode 100644
index 00000000..bbddeb70
--- /dev/null
+++ b/webui/pack_webui.go
@@ -0,0 +1,32 @@
+// +build ignore
+
+package main
+
+import (
+ "fmt"
+ "log"
+ "net/http"
+ "os"
+ "path/filepath"
+
+ "github.com/shurcooL/vfsgen"
+)
+
+func main() {
+ var cwd, _ = os.Getwd()
+
+ webUIAssets := http.Dir(filepath.Join(cwd, "webui/build"))
+
+ fmt.Println("Packing Web UI files ...")
+
+ err := vfsgen.Generate(webUIAssets, vfsgen.Options{
+ Filename: "webui/packed_assets.go",
+ PackageName: "webui",
+ BuildTags: "deploy_build",
+ VariableName: "WebUIAssets",
+ })
+
+ if err != nil {
+ log.Fatalln(err)
+ }
+}