(ctx context.Context, w io.Writer)
| 283 | } |
| 284 | |
| 285 | func StopAllProcessManagers(ctx context.Context, w io.Writer) error { |
| 286 | configFile, err := openGlobalConfigFile() |
| 287 | if err != nil { |
| 288 | return err |
| 289 | } |
| 290 | |
| 291 | defer configFile.Close() |
| 292 | |
| 293 | config := readGlobalProcessComposeJSON(configFile) |
| 294 | |
| 295 | for _, project := range config.Instances { |
| 296 | pid, _ := os.FindProcess(project.Pid) |
| 297 | err := pid.Signal(os.Interrupt) |
| 298 | if err != nil { |
| 299 | fmt.Printf("process-compose is not running. To start it, run `devbox services up`") |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | config.Instances = make(map[string]instance) |
| 304 | |
| 305 | err = writeGlobalProcessComposeJSON(config, configFile) |
| 306 | if err != nil { |
| 307 | return fmt.Errorf("failed to write global process-compose config: %w", err) |
| 308 | } |
| 309 | |
| 310 | return nil |
| 311 | } |
| 312 | |
| 313 | func AttachToProcessManager(ctx context.Context, w io.Writer, projectDir string, processComposeConfig ProcessComposeOpts) error { |
| 314 | configFile, err := openGlobalConfigFile() |
no test coverage detected