Skip to content

Commit f53dea7

Browse files
committed
fx local mode
1 parent 0b1b0e9 commit f53dea7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/init.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,16 @@ func configFileTemplate(tools []domain.Tool) string {
226226
} else {
227227
// In local mode with no tools specified, use the default tool list from plugins.GetToolVersions()
228228
var sortedTools []string
229+
seen := make(map[string]bool)
229230
for toolName := range defaultVersions {
230-
if defaultVersions[toolName] != "" {
231+
if defaultVersions[toolName] != "" && !seen[toolName] {
231232
sortedTools = append(sortedTools, toolName)
233+
seen[toolName] = true
232234
}
233235
}
234236
sort.Strings(sortedTools)
235237

236-
// Write sorted tools
238+
// Write sorted tools ONCE
237239
for _, toolName := range sortedTools {
238240
version := defaultVersions[toolName]
239241
sb.WriteString(fmt.Sprintf(" - %s@%s\n", toolName, version))

0 commit comments

Comments
 (0)