Shopify/shopify_theme

Problem with downloading new "sections" path/folder

sarhov opened this issue ยท 11 comments

So, theme download command doesn't download new "sections" path/folder.

firefox_2016-09-28_04-20-39 1

Theme watch doesn't work as well. It says

powershell_2016-09-28_04-29-56 1

I have tried put under whitelist_files, like this

sublime_text_2016-09-28_04-31-19 1

but had the same problem described above.

Yea I've noticed this doesn't work, just means I have to edit section files using the online editor!

I would say this is quite high priority feature. Editing html in admin isn't exactly what you want to do.

Temporary workaround, adds /sections to the default whitelist and rebuilds the gem:
gem uninstall theme
git clone https://github.com/Shopify/shopify_theme.git
sed -i -e 's/assets\//assets\/ sections\//g' shopify_theme/lib/shopify_theme/cli.rb
cd shopify_theme/
gem build shopify_theme.gemspec
gem install shopify_theme-0.0.25.gem

Thanks @cameroncowden!! Great workaround! :)

Thanks for @cameroncowden workaround. Alternatively, I did it by:

  • MACOS: Open to file /Library/Ruby/Gems/2.0.0/gems/shopify_theme-0.0.25/lib/shopify_theme/cli.rb. You might have to grant it writable permission (right click > get info > update to Read & Write)
    Windows: the path will look like "C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\shopify_theme-0.0.25\lib\shopify_theme\cli.rb"
  • Look for the "DEFAULT_WHITELIST" line and add sections/ at the end. This line will look like this:
    DEFAULT_WHITELIST = %w(layout/ assets/ config/ snippets/ templates/ locales/ sections/)
  • Save the file
  • Edit the config.yml to add sections/ into the :whitelist_files:
  • There you go.

+1

jklue commented

Thanks @luongvanphuc. It was nice to see the explanation.