Skip to content

[6.x] Clean Asset Meta Command#13934

Merged
jackmcdade merged 8 commits into6.xfrom
clean-asset-meta-command
Mar 2, 2026
Merged

[6.x] Clean Asset Meta Command#13934
jackmcdade merged 8 commits into6.xfrom
clean-asset-meta-command

Conversation

@jackmcdade
Copy link
Member

@jackmcdade jackmcdade commented Feb 14, 2026

Closes statamic/ideas#89


Note

Medium Risk
Deletes files from asset container disks, so incorrect orphan detection or path handling could remove valid metadata; tests reduce but don’t eliminate that risk.

Overview
Adds a new statamic:assets:meta-clean console command to find and delete orphaned asset .meta/*.yaml files (optionally scoped to a single container) and to remove now-empty .meta directories afterward.

Includes a --dry-run mode to list what would be deleted without changing disks, registers the command in ConsoleServiceProvider, and adds coverage for deletion, preservation of valid metadata, container scoping, and root/nested .meta paths.

Written by Cursor Bugbot for commit 2ed54f0. This will update automatically on new commits. Configure here.

@jackmcdade jackmcdade marked this pull request as ready for review February 14, 2026 04:24
@jackmcdade jackmcdade merged commit 27f94d7 into 6.x Mar 2, 2026
12 checks passed
@jackmcdade jackmcdade deleted the clean-asset-meta-command branch March 2, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The assets:meta command should clean up orphaned meta files

2 participants