Skip to content

Add --filter option to publish a subset of files#7

Merged
jordyvanderhaegen merged 3 commits intomasterfrom
feature/file-filter-flag
Apr 27, 2026
Merged

Add --filter option to publish a subset of files#7
jordyvanderhaegen merged 3 commits intomasterfrom
feature/file-filter-flag

Conversation

@jordyvanderhaegen
Copy link
Copy Markdown
Contributor

Summary

Adds a --filter option to the install command so callers can publish a subset of files instead of everything.

Usage

php artisan app:install --filter=Services
php artisan app:install --filter=Services --filter=Providers

Filters perform a case-insensitive substring match on the target path. Multiple values are OR-matched.

Changes

  • InstallCommand: adds --filter option via configure() override; forwards collected filters to FileInstaller methods (same pattern as --force)
  • FileInstaller: accepts array $filters in publishFile, publishFolder, and appendToFile; a private matchesFilters() helper does the matching; files that don't match return PublishResult::skipped() so they appear in the skipped count
  • Tests: 6 new test cases covering single filter, multiple filters, and filtering individual files inside a PublishableFolder
  • README: documents --filter usage

jordyvanderhaegen and others added 3 commits April 27, 2026 14:14
- Add `--filter` option (accepts multiple values) to InstallCommand
- Move filtering logic into FileInstaller alongside existing `force` handling
- Filtered-out files return PublishResult::skipped() and appear in the skipped count
- Support filtering individual files inside PublishableFolder
- Add tests covering single filter, multiple filters, and folder file filtering
- Document --filter usage in README

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Switch VALUE_OPTIONAL to VALUE_REQUIRED so --filter without a value
is rejected, while the option itself remains optional to pass.
Drop the array_filter cleanup that was needed to handle empty values.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Subclasses no longer need to declare --force in their $signature.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jordyvanderhaegen jordyvanderhaegen merged commit bf3c236 into master Apr 27, 2026
22 checks passed
@jordyvanderhaegen jordyvanderhaegen deleted the feature/file-filter-flag branch April 27, 2026 12:35
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.

1 participant