(deps commandDeps)
| 421 | } |
| 422 | |
| 423 | func currentWorkingDirectory(deps commandDeps) (string, error) { |
| 424 | if deps.getwd == nil { |
| 425 | return "", errors.New("cli: getwd dependency is required") |
| 426 | } |
| 427 | |
| 428 | wd, err := deps.getwd() |
| 429 | if err != nil { |
| 430 | return "", fmt.Errorf("cli: resolve current working directory: %w", err) |
| 431 | } |
| 432 | wd = strings.TrimSpace(wd) |
| 433 | if wd == "" { |
| 434 | return "", errors.New("cli: current working directory is empty") |
| 435 | } |
| 436 | return wd, nil |
| 437 | } |
no outgoing calls