1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Handle illegal verbose value (#1485)

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
Oliver Nocon 2020-04-29 15:05:00 +02:00 committed by GitHub
parent 3a4d4b2de7
commit 363f69da29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,9 +155,11 @@ func PrepareConfig(cmd *cobra.Command, metadata *config.StepData, stepName strin
GeneralConfig.NoTelemetry = true
}
if !GeneralConfig.Verbose {
if stepConfig.Config["verbose"] != nil && stepConfig.Config["verbose"].(bool) {
log.SetVerbose(stepConfig.Config["verbose"].(bool))
if !GeneralConfig.Verbose && stepConfig.Config["verbose"] != nil {
if verboseValue, ok := stepConfig.Config["verbose"].(bool); ok {
log.SetVerbose(verboseValue)
} else {
return fmt.Errorf("invalid value for parameter verbose: '%v'", stepConfig.Config["verbose"])
}
}