(target aghconfig.WriteTarget)
| 305 | } |
| 306 | |
| 307 | func ensureWriteTargetParent(target aghconfig.WriteTarget) error { |
| 308 | path := strings.TrimSpace(target.Path()) |
| 309 | if path == "" { |
| 310 | return errors.New("cli: config write target path is required") |
| 311 | } |
| 312 | if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { |
| 313 | return fmt.Errorf("cli: create config write target directory %q: %w", filepath.Dir(path), err) |
| 314 | } |
| 315 | return nil |
| 316 | } |
no test coverage detected