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

Function GetProcessManagerPort

internal/services/manager.go:363–377  ·  view source on GitHub ↗
(projectDir string)

Source from the content-addressed store, hash-verified

361}
362
363func GetProcessManagerPort(projectDir string) (int, error) {
364 configFile, err := openGlobalConfigFile()
365 if err != nil {
366 return 0, err
367 }
368
369 config := readGlobalProcessComposeJSON(configFile)
370
371 project, ok := config.Instances[projectDir]
372 if !ok {
373 return 0, usererr.WithUserMessage(fmt.Errorf("failed to find projectDir %s in config.Instances", projectDir), "process-compose is not running or it's config is missing. To start it, run `devbox services up`")
374 }
375
376 return project.Port, nil
377}
378
379func lockFile(file *os.File) error {
380 lockResult := make(chan error)

Callers 2

clientRequestFunction · 0.85

Calls 3

WithUserMessageFunction · 0.92
openGlobalConfigFileFunction · 0.85

Tested by

no test coverage detected