blob: 3eff71a5590f05dafa736ce0f84309fc21e5ab36 (
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
30
31
32
33
34
35
36
37
38
|
// +build ignore
package main
import (
"fmt"
"log"
"net/http"
"os"
"path/filepath"
"github.com/shurcooL/httpfs/filter"
"github.com/shurcooL/vfsgen"
)
func main() {
var cwd, _ = os.Getwd()
webUIAssets := filter.Skip(
http.Dir(filepath.Join(cwd, "webui/build")),
func(path string, fi os.FileInfo) bool {
return filter.FilesWithExtensions(".map")(path, fi)
},
)
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)
}
}
|