package cmd // import "twos.dev/winter/cmd" import ( "github.com/spf13/cobra" "twos.dev/winter/cliutils" ) func newServeCmd() *cobra.Command { return &cobra.Command{ Use: "serve", Short: cliutils.Sprintf("Alias of `winter build --serve`"), Long: cliutils.Sprintf(` Build, serve, and continually rebuild the website. Alias of winter build --serve. Builds the website, starts a web server, and monitors the filesystem for changes. When a change occurs, the website is selectively rebuilt according to the scope of the change. `), RunE: func(cmd *cobra.Command, args []string) error { buildCmd := newBuildCmd() if err := buildCmd.Flag(serveFlag).Value.Set("true"); err != nil { return err } return buildCmd.RunE(cmd, args) }, } }