ignore_files not working with directories in paths (on Windows)
Describe the bug I'm using config.yml like so:
development:
password: 12345
theme_id: "112344939"
store: ashop.myshopify.com
ignore_files:
- settings_data.json
That is successfully ignoring settings_data.json but when I have:
development:
password: 12345
theme_id: "112344939"
store: ashop.myshopify.com
ignore_files:
- config/settings_data.json
The settings_data.json file is not being ignored and is getting updated on the remote theme.
To Reproduce Steps to reproduce the behavior:
- Using the live theme
- theme watch --allow-live
Environment (please complete the following information):
- Windows 10
- ThemeKit 1.1.1 windows/amd64
- Editor VS code
- Ignore:
Additional context Just set up theme kit.
Hi @PhilSole
Thanks for the detailed report. Did you restart theme watch after changing the config?
Also, since you're on Windows, could you try writing it as config\settings_data.json or config\\settings_data.json.
Thanks @andyw8
I did restart theme watch.
The single backslash works but not the double. Is that backslash the normal syntax in config.yml for Windows?
In Windows, \ is the default path separator. Some programs expect\, but others use / for consistency with other platforms.
I'll keep this issue open until we make a decision on how to handle this.
Thanks. Yeah I don't recall the backslash being required in other web dev tools I've used on Windows. Seems like the / is generally the choice for consistency.
I have come up against this before and did a little playing around in this PR https://github.com/Shopify/themekit/pull/658 but never shipped it. Currently yes, I believe that we use OS specific file paths so you might see it work with a backslash instead, this is because I had assumed that most windows developers would be used to using backslashes instead of forward slashes. However it might seem prudent to accept both in configuration and just normalize them for the OS when they get used.
As an interim improvement, I've opened https://github.com/Shopify/themekit/pull/803 to update the documentation.