Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 365 forks source link

Download settings file on `slate-tools start` #641

Open zomars opened 6 years ago

zomars commented 6 years ago

Problem

There is no way to download changes made to the settings.json file from Slate.

Replication steps

  1. Upload your Slate theme to your store using slate-tools deploy.
  2. Change some settings using the Theme Editor.
  3. Run slate-tools start.
  4. Notice how the settings are being overwritten each time.

More Information

I know there's another issue about a possible sync command that focuses on downloading all changed files and it's not that easy to implement. In this case, simple changes made by the theme editor wouldn't cause much trouble to download since it's all saved in the settings.json file IMHO.

dan-gamble commented 6 years ago

Could you add the settings_data.json to the SLATE_IGNORE_FILES in the .env file?

e.g.

# The myshopify.com URL to your Shopify store
SLATE_STORE=mystore.myshopify.com

# The API password generated from a Private App
SLATE_PASSWORD=abc123

# The ID of the theme you wish to upload files too
SLATE_THEME_ID=1234567890

# A list of file patterns to ignore, with each list item seperated by ':'
SLATE_IGNORE_FILES=/config/settings_data.json
zomars commented 6 years ago

That would be one solution, but there are many cases where keeping this file tracked would be desirable.

t-kelly commented 6 years ago

@zomars are the changes made to settings_data.json something you feel should be part of your git tracking? In my experience, I have always wanted the version of settings_data.json that is tracked in my project to include default values and presets.

zomars commented 6 years ago

@t-kelly in some cases yes, I can use git to keep a backup history for settings, so we can rollback to a previous state easily.