MCPcopy Create free account
hub / github.com/compozy/agh / ensureWriteTargetParent

Function ensureWriteTargetParent

internal/cli/lifecycle.go:307–316  ·  view source on GitHub ↗
(target aghconfig.WriteTarget)

Source from the content-addressed store, hash-verified

305}
306
307func 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}

Callers 2

runConfigSetCommandFunction · 0.85
newConfigEditCommandFunction · 0.85

Calls 1

PathMethod · 0.65

Tested by

no test coverage detected