Browse Source

Automatically add missing .myshopify.com to domain for shopify add.

Allows for a shorter alias for the connection name without having to
specify the full domain.

Closes #15.
Dylan Smith 13 năm trước cách đây
mục cha
commit
ccc46f0a10
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      lib/shopify_api/cli.rb

+ 1 - 0
lib/shopify_api/cli.rb

@@ -25,6 +25,7 @@ module ShopifyAPI
         config = {'protocol' => 'https'}
         config['domain']   = ask("Domain? (leave blank for #{connection}.myshopify.com)")
         config['domain']   = "#{connection}.myshopify.com" if config['domain'].blank?
+        config['domain']   = "#{config['domain']}.myshopify.com" unless config['domain'].match(/[.:]/)
         puts "\nopen https://#{config['domain']}/admin/api in your browser to get API credentials\n"
         config['api_key']  = ask("API key?")
         config['password'] = ask("Password?")