(cfg *Config, pkg *devpkg.Package, w io.Writer, markdown bool)
| 74 | } |
| 75 | |
| 76 | func 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 | |
| 106 | func printCreateFiles(cfg *Config, w io.Writer, markdown bool) error { |
| 107 | if len(cfg.CreateFiles) == 0 { |
no test coverage detected