Shopify / themekit

Shopify theme development command line tool.
https://shopify.dev/tools/theme-kit
MIT License
1.2k stars 375 forks source link

Prevent specific files from being removed #972

Closed hagealex closed 2 years ago

hagealex commented 2 years ago

Is your feature request related to a problem? Please describe.

I'm currently working on a project where multiple shops will use the same theme. The code of our theme is in a Gitlab repository and we deploy the theme in all shops using the Themekit deploy command.

Now, as I'm working on that theme I discovered that the Themekit does the following, according to the documentation :

Any files that are in the connected Shopify store, but aren't on your local disk, will be removed from Shopify.

This causes me some trouble. The reason: In these shops custom templates for collections will be used a lot. So the clients create new collection templates using the Shopify page editor. Then these custom files for the templates will be put into the templates folder.

As I don't have these files in my theme, after every deployment command they are removed. Unless I don't put these files into my theme (which would be a mess because, as I mentioned, lots of shops will use this theme) I don't see how I can work on the theme, deploy changes into the shops and prevent the custom template files from being removed.

Describe the solution you'd like I would like to have an option for the deploy command to prevent specific files from being removed. Like

keep_files:
  - templates/collection.*.json

So that if Shopify detects "there are files in the connected store that aren't on the local disk, but these files match this pattern, so don't remove them".

hagealex commented 2 years ago

This can be closed. I've overseen the ignore_files option of the Themekit.