mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-14 22:55:43 +00:00
⚡ Fix the -r
flag behavior in config
command
This commit is contained in:
parent
64b22daa2a
commit
51eddd3ae4
@ -18,13 +18,7 @@ var configCmd = &cobra.Command{
|
|||||||
Short: fmt.Sprintf("Generate %s config with default values", misc.Software),
|
Short: fmt.Sprintf("Generate %s config with default values", misc.Software),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if config.Config.Config.Regenerate {
|
if config.Config.Config.Regenerate {
|
||||||
configWithDefaults, err := config.GetConfigWithDefaults()
|
if err := config.WriteConfig(&config.Config); err != nil {
|
||||||
if err != nil {
|
|
||||||
log.Error().Err(err).Msg("Failed generating config with defaults.")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := config.WriteConfig(configWithDefaults); err != nil {
|
|
||||||
log.Error().Err(err).Msg("Failed generating config with defaults.")
|
log.Error().Err(err).Msg("Failed generating config with defaults.")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user