Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jan 31, 2025
1 parent b4d5a38 commit 720cd2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ func initCobraConfig() {
return nil
})
RootCmd.SetHelpFunc(func(command *cobra.Command, args []string) {

if !(Contains(os.Args, "help") || Contains(os.Args, "--help") || Contains(os.Args, "-h")) {
arguments := os.Args[len(strings.Split(command.CommandPath(), " ")):]
if len(command.Flags().Args()) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/tui/templates/template_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ func ProcessJSONWithTemplate(input interface{}, template string) (string, error)
}

return buf.String(), nil
}
}
14 changes: 7 additions & 7 deletions pkg/list/list_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func FilterAndListStacks(stacksMap map[string]any, component string, template st
return fmt.Sprintf("No stacks found for component '%s'"+"\n", component), nil
}
sort.Strings(filteredStacks)

// If template is provided, convert to map for JSON processing
if template != "" {
stacksOutput := make(map[string]interface{})
Expand All @@ -47,16 +47,16 @@ func FilterAndListStacks(stacksMap map[string]any, component string, template st
}
result = stacksOutput
} else {
return strings.Join(filteredStacks, "\n") + "\n", nil
}
return strings.Join(filteredStacks, "\n") + "\n", nil
}
} else {
// List all stacks
// List all stacks
if template != "" {
result = stacksMap
} else {
stacks := lo.Keys(stacksMap)
sort.Strings(stacks)
return strings.Join(stacks, "\n") + "\n", nil
stacks := lo.Keys(stacksMap)
sort.Strings(stacks)
return strings.Join(stacks, "\n") + "\n", nil
}
}

Expand Down

0 comments on commit 720cd2d

Please sign in to comment.