package main import ( "bytes" "context" "fmt" "os" "os/signal" "strings" "syscall" "git.golem15.com/golem15/summercms/internal/build" "git.golem15.com/golem15/summercms/internal/dev" "git.golem15.com/golem15/summercms/modules/bonfire" "git.golem15.com/golem15/summercms/modules/diary" "git.golem15.com/golem15/summercms/modules/lagoon" ) func main() { args := os.Args[1:] g := bonfire.PeekGlobals(args) diary.Bootstrap(os.Stderr, diary.FromGlobals(g)) root, err := bonfire.NewRoot("summer", toolCommands(), os.Stdout, bonfire.WithVersion(bonfire.BuildVersion()), bonfire.OnGlobals(diary.ApplyGlobals)) if err != nil { os.Exit(bonfire.Fail(os.Stderr, "summer", err, g)) } os.Exit(bonfire.Execute(context.Background(), root, args)) } func toolCommands() []bonfire.Command { return append([]bonfire.Command{ buildCommand(), makePluginCommand(), makeModelCommand(), makeMigrationCommand(), makeCommandCommand(), makeJobCommand(), makeAdminControllerCommand(), addPluginCommand(), newCommand(), devCommand(), parityProxyCommand(), parityRecordCommand(), parityReplayCommand(), parityBroadcastsCommand(), parityUpstreamCommand(), docsBuildCommand(), docsSyncCommand(), docsServeCommand(), }, delegateCommands()...) } func buildCommand() bonfire.Command { return bonfire.Command{ Name: "build", Description: "Generate plugin imports and build the app binary", Long: `Reads summer.yaml of the application in the current directory (or the nearest one above it), generates plugins.gen.go and main.go from it, and runs go build into bin/, passing the manifest's build.tags as -tags. On a terminal a spinner runs while go build works. It ends with "Built bin/ in