Class: ShopifyCli::Tasks::EnsureDevStore

Inherits:
ShopifyCli::Task show all
Defined in:
lib/shopify-cli/tasks/ensure_dev_store.rb

Instance Method Summary collapse

Methods inherited from ShopifyCli::Task

call

Instance Method Details

#call(ctx) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/shopify-cli/tasks/ensure_dev_store.rb', line 6

def call(ctx)
  @ctx = ctx
  return ctx.puts(ctx.message(
    'core.tasks.ensure_dev_store.could_not_verify_store', project.env.shop
  )) if shop.nil?
  return if shop['transferDisabled'] == true
  return unless CLI::UI::Prompt.confirm(
    ctx.message('core.tasks.ensure_dev_store.convert_to_dev_store', project.env.shop)
  )
  ShopifyCli::PartnersAPI.query(ctx, 'convert_dev_to_test_store', input: {
    organizationID: shop['orgID'].to_i,
    shopId: shop['shopId'],
  })
  ctx.puts(ctx.message('core.tasks.ensure_dev_store.transfer_disabled', project.env.shop))
end