Merge pull request #372 from helmfile/tidy-up-var-scope

chore: Tidy up a local var scopinng for maintainability
This commit is contained in:
yxxhero 2022-09-18 17:46:24 +08:00 committed by GitHub
commit 7d88370310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -10,12 +10,13 @@ import (
// NewApplyCmd returns apply subcmd // NewApplyCmd returns apply subcmd
func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command { func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command {
applyOptions := &config.ApplyOptions{} applyOptions := &config.ApplyOptions{}
applyImpl := config.NewApplyImpl(globalCfg, applyOptions)
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "apply", Use: "apply",
Short: "Apply all resources from state file only when there are changes", Short: "Apply all resources from state file only when there are changes",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
applyImpl := config.NewApplyImpl(globalCfg, applyOptions)
err := config.NewCLIConfigImpl(applyImpl.GlobalImpl) err := config.NewCLIConfigImpl(applyImpl.GlobalImpl)
if err != nil { if err != nil {
return err return err