示例#1
0
func IfExit(err error) {
	if err != nil {
		log.Flush()
		fmt.Println(err)
		os.Exit(1)
	}
}
示例#2
0
func ifExit(err error) {
	if err != nil {
		logger.Errorln(err)
		log.Flush()
		os.Exit(0)
	}
}
示例#3
0
func Exit(err error) {
	status := 0
	if err != nil {
		log.Flush()
		fmt.Println(err)
		status = 1
	}
	os.Exit(status)
}
示例#4
0
func after(c *cli.Context) error {
	log.Flush()
	return nil
}
示例#5
0
		util.PrintPathPackage(do)

		// Populates chainID from the chain (if its not passed)
		IfExit(util.GetChainID(do))

		// Populates the tendermint config object for proper websocket connection
		config.Set("chain_id", do.ChainID)
		config.Set("log_level", "error")
		cfg.ApplyConfig(config)
	},

	Run: RunPackage,

	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		// Ensure that errors get written to screen and generally flush the log
		log.Flush()
	},
}

func Execute() {
	InitEPM()
	AddGlobalFlags()
	EPMCmd.Execute()
}

func InitEPM() {
	do = definitions.NowDo()
}

// Flags that are to be used by commands are handled by the Do struct
// Define the persistent commands (globals)