From 8d46f2fc6a18dad07703027c21d54fdaeb31947d Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 23 Sep 2024 16:06:29 -0500 Subject: [PATCH] fixes --- cli/htmgo/tasks/run/entschema.go | 11 ++++++++--- cli/htmgo/tasks/run/setup.go | 5 +---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cli/htmgo/tasks/run/entschema.go b/cli/htmgo/tasks/run/entschema.go index 168fc3a..d8453b4 100644 --- a/cli/htmgo/tasks/run/entschema.go +++ b/cli/htmgo/tasks/run/entschema.go @@ -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") + } } diff --git a/cli/htmgo/tasks/run/setup.go b/cli/htmgo/tasks/run/setup.go index 9581b55..6d7b956 100644 --- a/cli/htmgo/tasks/run/setup.go +++ b/cli/htmgo/tasks/run/setup.go @@ -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() }