- Add summer build with validated summer.yaml codegen - Generate stable main.go and plugins.gen.go then go build - Smoke-test the built hello binary greeter:hello command
34 lines
703 B
Go
34 lines
703 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"git.golem15.com/golem15/summercms/bonfire"
|
|
"git.golem15.com/golem15/summercms/internal/build"
|
|
)
|
|
|
|
func main() {
|
|
root := bonfire.NewRoot("summer", []bonfire.Command{buildCommand()}, os.Stdout)
|
|
root.SetArgs(os.Args[1:])
|
|
if err := root.Execute(); err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
func buildCommand() bonfire.Command {
|
|
return bonfire.Command{
|
|
Name: "build",
|
|
Description: "Generate plugin imports and build the app binary",
|
|
Run: func(ctx context.Context, in bonfire.Input, out bonfire.Output) error {
|
|
dir, err := os.Getwd()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return build.App(ctx, dir, out)
|
|
},
|
|
}
|
|
}
|