Luke
December 27, 2024, 1:10pm
1
When trying to do a theme pull to pull down content, I’m having issues where the CLI isn’t pulling down files, specifically templates currently. I’m noticing it seems to not be pulling alternative template. so for example I have collection.champagne-magnum.json
in my theme in Shopify but when trying to pull down with the following command, it isn’t pulling.
shopify theme pull --only templates/*.json
That doesn’t work, I’ve also tried the following and it still doesn’t work. So is this a bug in the CLI?
shopify theme pull --only templates/**/*.json
This is potentially very problematic as I use it in Github Actions and to pull down the latest content before doing a push. And if it isn’t able to pull down all the data its going to end up deleting it when it does a push. And I can’t use --nodelete
because I’d end up leaving old asset files in there (they get rebuilt).
And just to be clear, I’m even trying to run this locally to pull files down on the command line but it isn’t working.
Luke
December 27, 2024, 1:23pm
2
Not sure if its related to this issue →
opened 06:40AM - 04 Oct 23 UTC
closed 09:29AM - 22 Dec 23 UTC
Type: Bug
Area: @shopify/theme
The `shopify theme pull --only templates/*.json` command doesn't download new fi… les.
### Expected behavior
The `shopify theme pull -t <theme_id> --only templates/*.json` should download new files when they are created in the code editor.
### Actual behavior
The `shopify theme pull -t <theme_id> --only templates/*.json` doesn't download the new file.
### Reproduction steps
1. Create a new file at the admin code editor
2. `shopify theme pull -t <theme_id> --only templates/*.json` (notice nothing is downloaded)
3. `shopify theme pull -t <theme_id>` (notice the new file is downloaded)
### Operating System
macOS
### Shopify CLI version (check your project's `package.json` if you're not sure)
3.49.5
### Shell
zsh
### Node version (run `node -v` if you're not sure)
v20.2.0
### What language and version are you using in your application?
3.1.2
Luke
January 6, 2025, 1:36pm
3
Any chance this can get some attention? Its a huge blocker and breaking my pipeline.
I posted a similar issue on Github too.
opened 05:33PM - 27 Dec 24 UTC
Type: Bug
### Please confirm that you have:
- [x] Searched [existing issues](.) to see if… your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [x] Reproduced the issue in [the latest CLI version](https://www.npmjs.com/package/@shopify/cli).
### In which of these areas are you experiencing a problem?
Theme
### Expected behavior
I have two issues related to alt templates, e.g. `collection.whisky.json`.
1. Firstly I'm unable to pull down these templates, not sure if its also related to templates that have been created in the customiser. I'm using the following command to pull content down the theme:
```bash
shopify theme pull --only config/settings_data.json --only templates/*.json --only templates/customers/*.json --only templates/metaobject/*.json --only sections/*.json --only locales/*.json
```
2. When I try doing a push, I'm ignoring all the same as above to ensure nothings deleted, but low and behold it goes and deletes JSON templates when I use this command:
```bash
shopify theme push --store=the-bottle-club --ignore config/settings_data.json --ignore templates/*.json --ignore templates/customers/*.json --ignore templates/metaobject/*.json --ignore templates/*.liquid --ignore sections/*.json --ignore locales/*.json
```
Fortunately have these themes syncing with Github so I can get them back. But this messes up my CI/CD pipeline and it can't be trusted because I'll lose templates on deployments.
### Actual behavior
1. All templates should be pulled down, including the alt templates
2. JSON Templates should not be deleted because I passed the ignore flag for the templates folder including JSON files.
### Verbose output
N/A
### Reproduction steps
Pulling scenario:
1. Create another collection template in the customiser
2. Try doing a theme pull with `shopify theme pull --only templates/*.json`
3. Templates won't be pulled down
Pushing scenario
1. Push to a theme that doesn't have templates locally but exist remotely
2. Do a theme push with `shopify theme push --ignore templates/*.json`
3. Templates that exist remotely will be deleted
FYI I can't do a `--nodelete` here as I have to clean up the `assets` folder.
### Operating System
Mac OS 15.1
### Shopify CLI version (`shopify --version`)
3.72.2
### Shell
_No response_
### Node version (run `node -v` if you're not sure)
v20.11.1
### What language and version are you using in your application?
_No response_
Hey Luke!
Connecting with our devs on this - will update here asap!
Luke
January 6, 2025, 4:58pm
5
Thank you Liam!
Let me know if any more information is required.
Hi Luke,
Saw that you found a solution in partner slack, but also posting here that using the following format with quotes should work:
shopify theme pull --only "templates/*.json"