themekit icon indicating copy to clipboard operation
themekit copied to clipboard

Not deleting files on theme deploy by default

Open tommypepsi opened this issue 4 years ago • 6 comments

Is your feature request related to a problem? Please describe. Doing a "theme deploy" will delete files that are not in the local environment by default. This seems more dangerous to me than keeping them. For example, a store with a color swatch feature, if the client uploads their image for their color swatch in the assets folder then we do a "theme deploy", the client would loose their swatches.

Describe the solution you'd like I think it would make more sense if by default the files wouldn't be deleted and instead of having a "--nodelete" option, there should be a "--delete" option to do the same.

tommypepsi avatar Feb 22 '21 19:02 tommypepsi

The idea is that theme deploy fully syncs what you have on your local machine with the remote theme. If it is a concern that something is constantly changed in the remote theme then use --nodelete.

tanema avatar Feb 23 '21 15:02 tanema

I still think it's quite dangerous as a default. It's easy to forget to add --nodelete and loose files that the store owner or apps could have added to the theme. While I feel like keeping the files wouldn't change anything for anyone. Having a --delete option would just help to do an extra cleanup.

tommypepsi avatar Feb 26 '21 14:02 tommypepsi

If you add images to the ignore_files part of your config.yml (like - /\.(png|ttf|jpg|svg)$/), no images should be deleted on theme deploy. And if you don't add this, then those images would be downloaded on theme download.

I would recommend to run theme download before running theme deploy everytime anyways to avoid also overwriting other changes done by a client (e.g. in the settings_data.json) - something where --nodelete won't help you. This works of course only if you use something like Git and committed your changes (or at least added them to the index). Otherwise you would overwrite your changes.

hpawe01 avatar Mar 25 '21 22:03 hpawe01

I second this. It should be the other way round, -d to delete. There's not really any downsides to it being this way.

Take json templates - say the client adds 6 of them. New/forgetful developer does a small unrelated fix and theme deploys. Those templates are now gone and there's no getting them back.

What is the downside to no-delete by default and flagging for deletion? Other than "the idea is syncing".

jhealey5 avatar Oct 27 '21 13:10 jhealey5

@jhealey5 Sadly I think shopify is abandoning this project in favor of shopify CLI. I don't think we'll see new updates to themekit.

tommypepsi avatar Oct 27 '21 15:10 tommypepsi

Fantastic. CLI is also Fantastic. Shopifantastic as always.

jhealey5 avatar Nov 09 '21 10:11 jhealey5