MCPcopy Index your code
hub / github.com/jetify-com/devbox / printServices

Function printServices

internal/plugin/info.go:76–104  ·  view source on GitHub ↗
(cfg *Config, pkg *devpkg.Package, w io.Writer, markdown bool)

Source from the content-addressed store, hash-verified

74}
75
76func printServices(cfg *Config, pkg *devpkg.Package, w io.Writer, markdown bool) error {
77 _, contentPath := cfg.ProcessComposeYaml()
78 if contentPath == "" {
79 return nil
80 }
81 content, err := pkg.FileContent(contentPath)
82 if err != nil {
83 return errors.WithStack(err)
84 }
85 serviceNames, err := services.NamesFromProcessCompose(content)
86 if err != nil {
87 return errors.WithStack(err)
88 }
89 if len(serviceNames) == 0 {
90 return nil
91 }
92 services := ""
93 for _, serviceName := range serviceNames {
94 services += fmt.Sprintf("* %[1]s\n", serviceName)
95 }
96
97 _, err = fmt.Fprintf(
98 w,
99 "%sServices:\n%s\nUse `devbox services start|stop [service]` to interact with services\n\n",
100 lo.Ternary(markdown, "### ", ""),
101 services,
102 )
103 return errors.WithStack(err)
104}
105
106func printCreateFiles(cfg *Config, w io.Writer, markdown bool) error {
107 if len(cfg.CreateFiles) == 0 {

Callers 1

ReadmeFunction · 0.85

Calls 3

NamesFromProcessComposeFunction · 0.92
ProcessComposeYamlMethod · 0.80
FileContentMethod · 0.65

Tested by

no test coverage detected