func beforeCommand(c *cli.Context) error { // set the env vars from global options if c.GlobalString("runenv") != "production" { tokenFile = "cx_" + c.GlobalString("runenv") + ".json" fmt.Printf(ansi.Color(fmt.Sprintf("Running against %s environment\n", c.GlobalString("runenv")), "grey")) honeybadger.Environment = c.GlobalString("runenv") } else { honeybadger.Environment = "production" } if c.GlobalString("fayeEndpoint") != "" { fayeEndpoint = c.GlobalString("fayeEndpoint") } debugMode = c.GlobalBool("debug") var command string if len(c.Args()) >= 1 { command = c.Args().First() } if (command != "version") && (command != "help") && (command != "update") { initClients(c) } if (command != "update") && (VERSION != "dev") { defer backgroundRun() } return nil }