aboutsummaryrefslogtreecommitdiffstats
path: root/pack_webui.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-16 22:25:50 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-16 22:25:50 +0200
commitead4511250deb877e1867c2e38cbee9c27deb299 (patch)
tree09572e68634c7241eff7cb65bf94c02a6aac9a50 /pack_webui.go
parentd659d74131996cea06e39f90114e21b36e61f6fc (diff)
downloadgit-bug-ead4511250deb877e1867c2e38cbee9c27deb299.tar.gz
add the infrastructure for an embedded web UI + command
Diffstat (limited to 'pack_webui.go')
-rw-r--r--pack_webui.go29
1 files changed, 29 insertions, 0 deletions
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)
+ }
+}