Shopify / themekit

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

Config Reading Regression #904

Closed jlitrell closed 3 years ago

jlitrell commented 3 years ago

1.1.6 has introduced a regression for reading (variables) config files with lines that don't contain either "=" or ":". Guessing it's related to the fixing of #639.

[Side note: -v doesn't actually add any verbosity. Seems like a no-op.]

To Reproduce

  1. Put a line in the 'variables' file without '=' or ':' - e.g. a [section header]
  2. Run theme get -l

1.1.6 dies with "Can't separate key from value" 1.1.5 ignores those lines.

This obviously creates issues with real config files. Comment lines seem to be ok ("#abcd" passes). Empty values are also ok (lines ":" or "=" both pass).

$ theme version ThemeKit 1.1.6 linux/amd64

andyw8 commented 3 years ago

@jlitrell a .env file shouldn't contain '[sections]', it's not the same format as an ini file.

jlitrell commented 3 years ago

That makes it wildly less useful and more difficult to work with, especially in the real world with multiple clients/setups, but I guess we can do a local patch to fix it.

Thanks.