From f1c32bed498459a8f91657bc64d211349c40ff30 Mon Sep 17 00:00:00 2001 From: Chris Scott Date: Tue, 26 Jan 2021 13:33:45 -0500 Subject: [PATCH] Finish spinner after enable/disable --- internal/cli/rules.go | 44 +++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/internal/cli/rules.go b/internal/cli/rules.go index 035ad6be1..4ef5528f2 100644 --- a/internal/cli/rules.go +++ b/internal/cli/rules.go @@ -73,19 +73,23 @@ func enableRuleCmd(cli *cli) *cobra.Command { } else { return fmt.Errorf("No rule found with name: %q", name) } + return nil + }) - // @TODO Only display modified rules - rules, err := getRules(cli) + if err != nil { + return err + } - if err != nil { - return err - } + // @TODO Only display modified rules + rules, err := getRules(cli) - cli.renderer.RulesList(rules) + if err != nil { + return err + } - return nil - }) - return err + cli.renderer.RulesList(rules) + + return nil }, } @@ -115,19 +119,23 @@ func disableRuleCmd(cli *cli) *cobra.Command { } else { return fmt.Errorf("No rule found with name: %q", name) } + return nil + }) - // @TODO Only display modified rules - rules, err := getRules(cli) + if err != nil { + return err + } - if err != nil { - return err - } + // @TODO Only display modified rules + rules, err := getRules(cli) - cli.renderer.RulesList(rules) + if err != nil { + return err + } - return nil - }) - return err + cli.renderer.RulesList(rules) + + return nil }, }