Skip to content

Commit

Permalink
fix: Fixed when commands call without config file fails
Browse files Browse the repository at this point in the history
  • Loading branch information
wwoytenko committed Apr 28, 2024
1 parent 2ce6e40 commit 7864541
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/greenmask/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ func initConfig() {
log.Fatal().Err(err).Msg("")
}

// This solves problem with map structure described -> https://github.com/spf13/viper/issues/373
// that caused issue in Greenmask https://github.com/GreenmaskIO/greenmask/issues/76
if err := configUtils.ParseTransformerParamsManually(cfgFile, Config); err != nil {
log.Fatal().Err(err).Msg("error parsing transformer parameters")
if cfgFile != "" {
// This solves problem with map structure described -> https://github.com/spf13/viper/issues/373
// that caused issue in Greenmask https://github.com/GreenmaskIO/greenmask/issues/76
if err := configUtils.ParseTransformerParamsManually(cfgFile, Config); err != nil {
log.Fatal().Err(err).Msg("error parsing transformer parameters")
}
}
}

0 comments on commit 7864541

Please sign in to comment.