Skip to content

Commit

Permalink
Merge pull request #84 from GreenmaskIO/fix/command_without_config
Browse files Browse the repository at this point in the history
fix: Fixed when commands call without config file fails
  • Loading branch information
wwoytenko authored Apr 28, 2024
2 parents 2ce6e40 + 7864541 commit e2d52dd
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 e2d52dd

Please sign in to comment.