Fixed directory only pattern when using --only flag #5251
+103
−0
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.
This commit fixes an issue in the matchGlob to match directories when filtering through files
WHY are these changes introduced?
Closes: #4855
There was a bug in which passing a directory to the
only
flag would not work.It turns out it wasn't working with the
ignore
flag either.WHAT is this pull request doing?
Added some additional logic to the
matchGlob
method which looks for certain patterns. Now it also checks for folder structure patterns likeassets/
Added tests for both
only
andignore
flags.Example
Before:
CLI.broken.--only.mp4
After:
CLI.--only.fix.mp4
How to test your changes?
Pull down the branch
Build the branch
If in a directory with a theme:
- delete two different folders like
assets
andtemplates
- run
shopify theme pull -t <your_thene> -o templates/
- You should only see the templates folder be synced
If in a blank directory:
- run
shopify theme pull -t <your_theme> -o templates/
- You should only see the templates folder in your directory
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist