|
|
@ -49,6 +49,7 @@ var (
|
|
|
|
filterOpts FilterOpts
|
|
|
|
filterOpts FilterOpts
|
|
|
|
includeTestOutput bool
|
|
|
|
includeTestOutput bool
|
|
|
|
outputFile string
|
|
|
|
outputFile string
|
|
|
|
|
|
|
|
configFileError error
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// RootCmd represents the base command when called without any subcommands
|
|
|
|
// RootCmd represents the base command when called without any subcommands
|
|
|
@ -134,7 +135,14 @@ func initConfig() {
|
|
|
|
|
|
|
|
|
|
|
|
// If a config file is found, read it in.
|
|
|
|
// If a config file is found, read it in.
|
|
|
|
if err := viper.ReadInConfig(); err != nil {
|
|
|
|
if err := viper.ReadInConfig(); err != nil {
|
|
|
|
colorPrint(check.FAIL, fmt.Sprintf("Failed to read config file: %v\n", err))
|
|
|
|
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
|
|
|
os.Exit(1)
|
|
|
|
// Config file not found; ignore error for now to prevent commands
|
|
|
|
|
|
|
|
// which don't need the config file exiting.
|
|
|
|
|
|
|
|
configFileError = err
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// Config file was found but another error was produced
|
|
|
|
|
|
|
|
colorPrint(check.FAIL, fmt.Sprintf("Failed to read config file: %v\n", err))
|
|
|
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|