Skip to content

Commit

Permalink
copy assets on run if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
maddalax committed Oct 24, 2024
1 parent 7af750b commit df490ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions cli/htmgo/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := ""
Expand Down
6 changes: 5 additions & 1 deletion cli/htmgo/tasks/run/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down
9 changes: 1 addition & 8 deletions cli/htmgo/tasks/run/setup.go
Original file line number Diff line number Diff line change
@@ -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()
}

0 comments on commit df490ae

Please sign in to comment.