aboutsummaryrefslogtreecommitdiffstats
path: root/pack_webui.go
blob: 845b150b87989e3f5870abe2424ec2f7a36d45e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)
	}
}