fixes
This commit is contained in:
parent
2c0ea0da67
commit
8d46f2fc6a
2 changed files with 9 additions and 7 deletions
|
|
@ -1,11 +1,16 @@
|
||||||
package run
|
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) {
|
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() {
|
func EntGenerate() {
|
||||||
process.RunOrExit("bash -c GOWORK=off go generate ./ent")
|
if dirutil.HasFileFromRoot("ent/schema") {
|
||||||
|
process.RunOrExit("GOWORK=off go generate ./ent")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package run
|
package run
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/maddalax/htmgo/cli/htmgo/internal/dirutil"
|
|
||||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/astgen"
|
"github.com/maddalax/htmgo/cli/htmgo/tasks/astgen"
|
||||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/copyassets"
|
"github.com/maddalax/htmgo/cli/htmgo/tasks/copyassets"
|
||||||
"github.com/maddalax/htmgo/cli/htmgo/tasks/css"
|
"github.com/maddalax/htmgo/cli/htmgo/tasks/css"
|
||||||
|
|
@ -16,7 +15,5 @@ func Setup() {
|
||||||
astgen.GenAst(process.ExitOnError)
|
astgen.GenAst(process.ExitOnError)
|
||||||
css.GenerateCss(process.ExitOnError)
|
css.GenerateCss(process.ExitOnError)
|
||||||
|
|
||||||
if dirutil.HasFileFromRoot("ent/schema") {
|
|
||||||
EntGenerate()
|
EntGenerate()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue