// Main entrypoint, typically called from a data repository. Calling Main() relinquishes
// control to Summon so it can manage the command line arguments and instantiation of assets
// located in the packr.Box data repository parameter.
// Config opts functions are optional.
// See https://github.com/gobuffalo/packr/tree/master/v2 for more information on packr Boxes.
Main entrypoint, typically called from a data repository. Calling Main() relinquishes
control to Summon so it can manage the command line arguments and instantiation of assets
located in the packr.Box data repository parameter.
Config opts functions are optional.
// Main entrypoint typically called from a data repository . Calling Main () relinquishes // control to Summon so it can manage the command line arguments and instantiation of assets // located in the packr . Box data repository parameter . // Config opts functions are optional . // See https : // github . com / gobuffalo / packr / tree / master / v2 for more information on packr Boxes .
func Main(args []string, box *packr.Box, opts ...option) int {
	options := &MainOptions{}
	for _, o := range opts {
		o(options)
	}
	summon.Name = args[0]
	s, err := summon.New(box)
	if err != nil {
		fmt.Fprintf(os.Stderr, "unable to create initial box: %v", err)
		return 1
	}
	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt, syscall.SIGTERM)
	go func() {
		for range c {
			os.Exit(0)
		}
	}()
	rootCmd := cmd.CreateRootCmd(s, os.Args, *options)
	err = rootCmd.Execute()
	if err != nil {
		if exitError, ok := err.(*exec.ExitError); ok {
			return exitError.ExitCode()
		}
		return 1
	}
	return 0
}
func Main ( args [ ] string , box * packr . Box , opts ... option ) int { options := & MainOptions { } for _ , o := range opts { o ( options ) } summon . Name = args [ 0 ] s , err := summon . New ( box ) if err != nil { fmt . Fprintf ( os . Stderr , " " , err ) return 1 } c := make ( chan os . Signal ) signal . Notify ( c , os . Interrupt , syscall . SIGTERM ) go func ( ) { for range c { os . Exit ( 0 ) } } ( ) rootCmd := cmd . CreateRootCmd ( s , os . Args , * options ) err = rootCmd . Execute ( ) if err != nil { if exitError , ok := err . ( * exec . ExitError ) ; ok { return exitError . ExitCode ( ) } return 1 } return 0 }
Main entrypoint, typically called from a data repository.
Main entrypoint typically called from a data repository .