fix: create internal/frontend dir if not exists during build

fixes issue #5
This commit is contained in:
Jordan Knott 2020-07-19 13:28:02 -05:00
parent 66a2931ab8
commit 89bde32427

View File

@ -32,6 +32,9 @@ func (Frontend) Build() error {
type Backend mg.Namespace type Backend mg.Namespace
func (Backend) GenFrontend() error { func (Backend) GenFrontend() error {
if _, err := os.Stat("internal/frontend/"); os.IsNotExist(err) {
os.Mkdir("internal/frontend/", 0755)
}
var fs http.FileSystem = http.Dir("frontend/build") var fs http.FileSystem = http.Dir("frontend/build")
err := vfsgen.Generate(fs, vfsgen.Options{ err := vfsgen.Generate(fs, vfsgen.Options{
Filename: "internal/frontend/frontend_generated.go", Filename: "internal/frontend/frontend_generated.go",