diff --git a/cli/htmgo/runner.go b/cli/htmgo/runner.go index ab27c440..2352d39a 100644 --- a/cli/htmgo/runner.go +++ b/cli/htmgo/runner.go @@ -106,8 +106,7 @@ func main() { } else if taskName == "ast" { _ = astgen.GenAst(process.ExitOnError) } else if taskName == "run" { - _ = astgen.GenAst(process.ExitOnError) - _ = css.GenerateCss(process.ExitOnError) + run.MakeBuildable() _ = run.Server(process.ExitOnError) } else if taskName == "template" { name := "" diff --git a/cli/htmgo/tasks/run/build.go b/cli/htmgo/tasks/run/build.go index e4680722..724e8855 100644 --- a/cli/htmgo/tasks/run/build.go +++ b/cli/htmgo/tasks/run/build.go @@ -9,10 +9,14 @@ import ( "os" ) -func Build() { +func MakeBuildable() { copyassets.CopyAssets() astgen.GenAst(process.ExitOnError) css.GenerateCss(process.ExitOnError) +} + +func Build() { + MakeBuildable() process.RunOrExit(process.NewRawCommand("", "mkdir -p ./dist")) diff --git a/cli/htmgo/tasks/run/setup.go b/cli/htmgo/tasks/run/setup.go index d48d42d9..0dd27d6b 100644 --- a/cli/htmgo/tasks/run/setup.go +++ b/cli/htmgo/tasks/run/setup.go @@ -1,19 +1,12 @@ package run import ( - "github.com/maddalax/htmgo/cli/htmgo/tasks/astgen" - "github.com/maddalax/htmgo/cli/htmgo/tasks/copyassets" - "github.com/maddalax/htmgo/cli/htmgo/tasks/css" "github.com/maddalax/htmgo/cli/htmgo/tasks/process" ) func Setup() { process.RunOrExit(process.NewRawCommand("", "go mod download")) process.RunOrExit(process.NewRawCommand("", "go mod tidy")) - - copyassets.CopyAssets() - astgen.GenAst(process.ExitOnError) - css.GenerateCss(process.ExitOnError) - + MakeBuildable() EntGenerate() }