copy assets on run if needed
This commit is contained in:
parent
7af750b9e7
commit
df490ae04b
3 changed files with 7 additions and 11 deletions
|
|
@ -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 := ""
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue