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

Function removeFileIfExists

internal/cli/lifecycle.go:235–249  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

233}
234
235func removeFileIfExists(path string) (bool, error) {
236 trimmed := strings.TrimSpace(path)
237 if trimmed == "" {
238 return false, nil
239 }
240 err := os.Remove(trimmed)
241 switch {
242 case err == nil:
243 return true, nil
244 case errors.Is(err, os.ErrNotExist):
245 return false, nil
246 default:
247 return false, fmt.Errorf("cli: remove runtime artifact %q: %w", trimmed, err)
248 }
249}
250
251func lifecycleBundle(title string, record lifecycleRecord) outputBundle {
252 rows := []keyValue{

Callers 1

removeRuntimeArtifactsFunction · 0.85

Calls 2

RemoveMethod · 0.65
IsMethod · 0.45

Tested by

no test coverage detected