Add --filter option to publish a subset of files#7
Merged
jordyvanderhaegen merged 3 commits intomasterfrom Apr 27, 2026
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--filteroption to the install command so callers can publish a subset of files instead of everything.Usage
Filters perform a case-insensitive substring match on the target path. Multiple values are OR-matched.
Changes
InstallCommand: adds--filteroption viaconfigure()override; forwards collected filters toFileInstallermethods (same pattern as--force)FileInstaller: acceptsarray $filtersinpublishFile,publishFolder, andappendToFile; a privatematchesFilters()helper does the matching; files that don't match returnPublishResult::skipped()so they appear in the skipped countPublishableFolder--filterusage