MCPcopy
hub / github.com/kptdev/kpt / delete

Method delete

internal/util/sync/sync.go:195–203  ·  view source on GitHub ↗

delete removes the dependency if it exists

(dependency kptfile.Dependency)

Source from the content-addressed store, hash-verified

193
194// delete removes the dependency if it exists
195func (c Command) delete(dependency kptfile.Dependency) error {
196 path := filepath.Join(c.Dir, dependency.Name)
197 fmt.Fprintf(c.StdOut, "deleting %q from %q\n", dependency.Name, path)
198 if c.DryRun {
199 return nil
200 }
201
202 return os.RemoveAll(path)
203}

Callers 3

syncMethod · 0.95
pFunction · 0.80

Calls 1

RemoveAllMethod · 0.45

Tested by

no test coverage detected