From 25570b2b4bbbd09460f6faae915baaa124fdc5c9 Mon Sep 17 00:00:00 2001 From: Romain Beuque Date: Thu, 16 Jan 2020 14:52:17 +0100 Subject: [PATCH] fix: config: dashboard prefix setter should be configured after Init plugins In case we are using Init plugins to register new configstore provider Signed-off-by: Romain Beuque --- cmd/utask/root.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/utask/root.go b/cmd/utask/root.go index 31472e28..b0c7571d 100644 --- a/cmd/utask/root.go +++ b/cmd/utask/root.go @@ -118,14 +118,6 @@ var rootCmd = &cobra.Command{ server = api.NewServer() server.WithAuth(defaultAuthHandler) - cfg, err := utask.Config(store) - if err != nil { - return err - } - server.SetDashboardPathPrefix(cfg.DashboardPathPrefix) - server.SetDashboardAPIPathPrefix(cfg.DashboardAPIPathPrefix) - server.SetEditorPathPrefix(cfg.EditorPathPrefix) - for _, err := range []error{ // register builtin executors builtin.Register(), @@ -143,6 +135,14 @@ var rootCmd = &cobra.Command{ } } + cfg, err := utask.Config(store) + if err != nil { + return err + } + server.SetDashboardPathPrefix(cfg.DashboardPathPrefix) + server.SetDashboardAPIPathPrefix(cfg.DashboardAPIPathPrefix) + server.SetEditorPathPrefix(cfg.EditorPathPrefix) + if utask.FDebug { log.SetLevel(log.DebugLevel) }