func registerBefore(ctx *cli.Context) error { setMcConfigDir(ctx.GlobalString("config-folder")) globalQuietFlag = ctx.GlobalBool("quiet") globalMimicFlag = ctx.GlobalBool("mimic") globalDebugFlag = ctx.GlobalBool("debug") globalJSONFlag = ctx.GlobalBool("json") if globalDebugFlag { console.NoDebugPrint = false } // Disable color themes. if ctx.GlobalBool("no-color") == true { console.SetColorOff() } // Verify golang runtime verifyMCRuntime() // Migrate any old version of config / state files to newer format. migrate() // Checkconfig if it can be read checkConfig() return nil }
// Set global states. NOTE: It is deliberately kept monolithic to ensure we dont miss out any flags. func setGlobals(quiet, debug, json, noColor bool) { globalQuiet = quiet globalDebug = debug globalJSON = json globalNoColor = noColor // Enable debug messages if requested. if globalDebug == true { console.DebugPrint = true } // Disable colorified messages if requested. if globalNoColor == true { console.SetColorOff() } }