MCPcopy Create free account
hub / github.com/github/gh-aw / generateNetworkConfig

Method generateNetworkConfig

pkg/cli/interactive.go:662–680  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

660}
661
662func (b *InteractiveWorkflowBuilder) generateNetworkConfig() string {
663 interactiveLog.Printf("Generating network config: network=%s", b.NetworkAccess)
664 switch b.NetworkAccess {
665 case "ecosystem":
666 return "network:\n allowed:\n - defaults\n - python\n - node\n - go\n - java\n"
667 default:
668 // Handle comma-separated networks (e.g. "defaults,node,python")
669 parts := strings.Split(b.NetworkAccess, ",")
670 if len(parts) == 1 {
671 return fmt.Sprintf("network: %s\n", parts[0])
672 }
673 var cfg strings.Builder
674 cfg.WriteString("network:\n allowed:\n")
675 for _, p := range parts {
676 fmt.Fprintf(&cfg, " - %s\n", strings.TrimSpace(p))
677 }
678 return cfg.String()
679 }
680}
681
682func (b *InteractiveWorkflowBuilder) generateToolsConfig() string {
683 if len(b.Tools) == 0 {

Calls 2

PrintfMethod · 0.45
StringMethod · 0.45

Tested by 1