Skip to content

feat(clean): add --check flag to fail when cleanup is pending - #395

Merged
jongio merged 1 commit into
mainfrom
feat/387-clean-check
Aug 3, 2026
Merged

jongio merged 1 commit into
mainfrom
feat/387-clean-check

Conversation

@jongio

@jongio jongio commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Closes #387

What

Adds --check to grut clean so scripts can fail when transient data needs cleanup, without deleting anything.

Behavior

  • grut clean --check previews the same targets as the default command.
  • Exits successfully when there is nothing to clean.
  • Returns an error when cleanup targets are present.
  • Works with --json.
  • --check never deletes, even when combined with --force.

Follows the --check convention already established by grut status --check.

Tests

cmd/clean_test.go covers the clean and dirty exit paths, JSON output, and the --check --force no-delete guarantee.

Closes #387

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jongio
jongio merged commit 6c6fb0c into main Aug 3, 2026
7 of 8 checks passed
@jongio
jongio deleted the feat/387-clean-check branch August 3, 2026 04:50
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.

Add check mode to grut clean

1 participant