Shopify / shopify_theme

A console tool for interacting with Shopify Theme Assets.
http://shopify.github.io/shopify_theme
MIT License
645 stars 135 forks source link

type mismatch on `theme replace` #197

Open marcosalles opened 8 years ago

marcosalles commented 8 years ago

When executing theme replace, the gem crashes. The regex is not being interpreted as a regex.

lib/shopify_theme/cli.rb:144:in `=~': type mismatch: String given (TypeError)
    from /usr/local/lib/ruby/gems/2.3.0/gems/shopify_theme-0.0.25/lib/shopify_theme/cli.rb:144:in `block (2 levels) in replace'
    from /usr/local/lib/ruby/gems/2.3.0/gems/shopify_theme-0.0.25/lib/shopify_theme/cli.rb:144:in `any?'
    from /usr/local/lib/ruby/gems/2.3.0/gems/shopify_theme-0.0.25/lib/shopify_theme/cli.rb:144:in `block in replace'
    from /usr/local/lib/ruby/gems/2.3.0/gems/shopify_theme-0.0.25/lib/shopify_theme/cli.rb:143:in `each'
    from /usr/local/lib/ruby/gems/2.3.0/gems/shopify_theme-0.0.25/lib/shopify_theme/cli.rb:143:in `replace'
    from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/lib/ruby/gems/2.3.0/gems/shopify_theme-0.0.25/bin/theme:26:in `<top (required)>'
    from /usr/local/bin/theme:23:in `load'
    from /usr/local/bin/theme:23:in `<main>'
marcosalles commented 8 years ago

build is failing due to certificate failure

corbanb commented 8 years ago

@marcosalles can you explain this? are you saying its a api key issue?

marcosalles commented 8 years ago

From the logs:

# Running:
...................F.......
Finished in 1.104586s, 24.4436 runs/s, 43.4552 assertions/s.
  1) Failure:
CA Certificate Validity#test_0001_verifies that the local certificate matches with that on haxx.se [/home/travis/build/Shopify/shopify_theme/spec/smoke/ca_cert_spec.rb:35]:
Could not connect to http://curl.haxx.se/ca/cacert.pem. Verify that certificate is still hosted.

From looking at ca_cert_spec#31 I think it might just be a matter of using HTTPS instead of HTTP protocol to download the remote_file.

corbanb commented 8 years ago

@marcosalles is this configurable. wasn't seeing it at a glance. also sending files work fine with watch just not replace.

marcosalles commented 8 years ago

@corbanb Yes watch works perfectly. The issue affects only replace, as is exposed in the description:

When executing theme replace ...

I don't think this is easily configurable, but it's also not related to https://github.com/Shopify/shopify_theme/issues/197. The build failure is another issue completely, and I think it might be easily fixed by updating request code which fetches the .pem key.

alrick commented 7 years ago

Any news about this?

marcosalles commented 7 years ago

@alrick the maintainer is not active, but the fix on https://github.com/Shopify/shopify_theme/pull/198 does work and doesn't create any new issues as far as I've tested

alrick commented 7 years ago

@marcosalles thx!