From 2b75fec603d6f3a879ac7aab1dd6426836e5db12 Mon Sep 17 00:00:00 2001 From: Mikita Iwanowski Date: Tue, 15 Oct 2024 09:25:20 +0200 Subject: [PATCH] fix: load features from config (#4747) --- cli/config/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/config/config.go b/cli/config/config.go index a8c2fcf2e7..030b149a3b 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -36,8 +36,9 @@ const ( // Init initializes and loads the mondoo config func Init(rootCmd *cobra.Command) { - cobra.OnInitialize(InitViperConfig) - Features = getFeatures() + cobra.OnInitialize(InitViperConfig, func() { + Features = getFeatures() + }) // persistent flags are global for the application rootCmd.PersistentFlags().StringVar(&UserProvidedPath, "config", "", "Set config file path (default $HOME/.config/mondoo/mondoo.yml)") }