This commit is contained in:
maddalax 2024-09-23 16:06:29 -05:00
parent 2c0ea0da67
commit 8d46f2fc6a
2 changed files with 9 additions and 7 deletions

View file

@ -1,11 +1,16 @@
package run
import "github.com/maddalax/htmgo/cli/htmgo/tasks/process"
import (
"github.com/maddalax/htmgo/cli/htmgo/internal/dirutil"
"github.com/maddalax/htmgo/cli/htmgo/tasks/process"
)
func EntNewSchema(name string) {
process.RunOrExit("bash -c GOWORK=off go run -mod=mod entgo.io/ent/cmd/ent new " + name)
process.RunOrExit("GOWORK=off go run -mod=mod entgo.io/ent/cmd/ent new " + name)
}
func EntGenerate() {
process.RunOrExit("bash -c GOWORK=off go generate ./ent")
if dirutil.HasFileFromRoot("ent/schema") {
process.RunOrExit("GOWORK=off go generate ./ent")
}
}

View file

@ -1,7 +1,6 @@
package run
import (
"github.com/maddalax/htmgo/cli/htmgo/internal/dirutil"
"github.com/maddalax/htmgo/cli/htmgo/tasks/astgen"
"github.com/maddalax/htmgo/cli/htmgo/tasks/copyassets"
"github.com/maddalax/htmgo/cli/htmgo/tasks/css"
@ -16,7 +15,5 @@ func Setup() {
astgen.GenAst(process.ExitOnError)
css.GenerateCss(process.ExitOnError)
if dirutil.HasFileFromRoot("ent/schema") {
EntGenerate()
}
EntGenerate()
}