-
Notifications
You must be signed in to change notification settings - Fork 201
Add --only
parameter to filter files on theme push
/theme pull
commands
#1892
Conversation
👋 Hello, @MeredithCastile! :) In many command-line tools, the flag To avoid using Still, I'm not entirely sure it's a good idea 😅 What do you think about this? Thanks a lot! |
Hmm, I'm not sure. Filter seems more intuitive and comprehensible to me than query. One thing your questions have raised for me, @karreiro, is whether or not we need a shortcut/alias for every flag. If we support only full words for rarer flag, then we could have more than one starting with the same letter. @pedropinerashopify, curious if you agree with the idea that every flag does NOT need a one-letter shortcut? |
(cc @pepicrft) Generally, when I'm using command-line tools, I usually use the shortcuts, and when the commands get too lengthy, I tend to create aliases for them (but this is a total personal use/opinion). |
I agree that
I've seen CLIs doing that as a way to disambiguate and I think it's something we can adopt here too. |
🤯 |
--query
parameter to filter files on theme push
/theme pull
commands--filter
parameter to filter files on theme push
/theme pull
commands
Ah, that's such an interesting idea, @pepicrft. So then I suppose there are 2 possibilities (unless we widen the scope of this issue): POSSIBILITY 1: case-sensitive shortcuts--force / -f Pro: More intuitive language POSSIBILITY 2: just go with query--query / -q Pro: No risk of the "user error" stated above __ I don't know how disruptive an accidental force command would be, so I'm not well-positioned to weigh between these options. |
Just throwing another option out (sorry 😄) What about
|
No reason to be sorry! This approach is awesome :) It makes the command much more expressive! Thanks a lot, @macournoyer 🚀 PS.: I believe we may keep case-sensitive shortcuts in mind for future scenarios, but for this PR, I believe the |
--filter
parameter to filter files on theme push
/theme pull
commands--only
parameter to filter files on theme push
/theme pull
commands
@macournoyer Such an elegant solution! Thank you! |
Is there a way to pass multiple
Right now it only pulls the last only option which is |
@jibinycricket You can use the command |
…me pull`/`push` - updates work from Shopify#1892 - see comment Shopify#1892 (comment)
PR addressing #1892 (comment).... #2002 |
These updates fix an issue where a local `package.json` file was being deleted despite being in the `.shopifyignore` file. - update `download_file!` method to use similar "ignore" handling as the `enqueue` method... using `ignore?` method added in Shopify#1892 - extract `ignore_path?` method from `ignore?` method so it can be called separately from an operation - update `ignore_path?` to check for a File object and extract the path from that
WHY are these changes introduced?
Currently, users can't filter files when they execute
theme pull
(#1558) ortheme push
. This PR introduces a new-o
/--only
parameter to take care of that.WHAT is this pull request doing?
This PR introduces the
ShopifyCLI::Theme::IncludeFilter
class, which behaves similarly to theShopifyCLI::Theme::IgnoreFilter
, but includes files that match with the query instead of excluding them.How to test your changes?
Run the following commands for testing the new
--only
parameter and notice that all files will be ignored, except the ones in thetemplates
directory:Post-release steps
Update documentation with the new
-o
/--only=PATTERN
parameter: https://shopify.dev/themes/tools/cli/theme-commands#push, https://shopify.dev/themes/tools/cli/theme-commands#pull.Update checklist