From 2663ac4f1b4852af856f2559e15c22de26223fe2 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sun, 18 Sep 2022 09:43:51 +0000 Subject: [PATCH] chore: Tidy up a local var scopinng for maintainability Ref https://github.com/helmfile/helmfile/pull/279#discussion_r973675321 Signed-off-by: Yusuke Kuoka --- cmd/apply.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/apply.go b/cmd/apply.go index 29af40ef..03f10302 100644 --- a/cmd/apply.go +++ b/cmd/apply.go @@ -10,12 +10,13 @@ import ( // NewApplyCmd returns apply subcmd func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command { applyOptions := &config.ApplyOptions{} - applyImpl := config.NewApplyImpl(globalCfg, applyOptions) cmd := &cobra.Command{ Use: "apply", Short: "Apply all resources from state file only when there are changes", RunE: func(cmd *cobra.Command, args []string) error { + applyImpl := config.NewApplyImpl(globalCfg, applyOptions) + err := config.NewCLIConfigImpl(applyImpl.GlobalImpl) if err != nil { return err