mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
150b5d489c
Now produce by default a build with the packed webui, to make it go gettable properly. fix #33
39 lines
654 B
Go
39 lines
654 B
Go
// +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: "!debugwebui",
|
|
VariableName: "WebUIAssets",
|
|
})
|
|
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
}
|