From 747fad2d37e5ad9ccdb01bb93b68a7b8f7cf2e51 Mon Sep 17 00:00:00 2001 From: umaniy Date: Tue, 4 Jul 2023 09:00:36 -0700 Subject: [PATCH] feat(config): not exiting process after update and reloading config --- pkg/core/core.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/core/core.go b/pkg/core/core.go index f925f9c..f7668cb 100644 --- a/pkg/core/core.go +++ b/pkg/core/core.go @@ -215,10 +215,14 @@ func (eb *EarlybirdCfg) ConfigInit() { if *ptrStreamInput || eb.Config.GitStream { eb.Config.SearchDir = "" } - // Check to see if the user opted to update. If they choose this option - // the configuration files will be updated and the program will exit. + // Check to see if the user opted to update config. If they choose this option + // the configuration files will be updated and load config again. if *ptrUpdateFlag { doUpdate(eb.Config.ConfigDir, eb.Config.RulesConfigDir, earlybirdConfigPath, cfgreader.Settings.ConfigFileURL, eb.Config.RuleModulesFilenameMap) + err = cfgreader.LoadConfig(&cfgreader.Settings, earlybirdConfigPath) + if err != nil { + log.Fatal("failed to load Earlybird config", err) + } } // Set the skip options (what not to scan) from configs @@ -374,5 +378,4 @@ func doUpdate(configDir, rulesConfigDir, configPath, appConfigURL string, ruleMo log.Fatal("Failed to update config:", err) } log.Println("Configurations updated. Exiting") - os.Exit(0) }