Module: Commercelayer::CLI::Bootstrappers

Included in:
Base
Defined in:
lib/commercelayer/cli/bootstrappers.rb,
lib/commercelayer/cli/bootstrappers/datocms.rb,
lib/commercelayer/cli/bootstrappers/contentful.rb

Defined Under Namespace

Classes: Contentful, DatoCMS

Instance Method Summary collapse

Instance Method Details

#bootstrap_data!(destination) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/commercelayer/cli/bootstrappers.rb', line 8

def bootstrap_data!(destination)
  commercelayer_client.authorize!
  case destination
  when "datocms"
    if yes? "Warning: this will erase your DatoCMS data. Continue?", :yellow
      say "Exporting data to DatoCMS...", :blue
      DatoCMS.new.bootstrap!
    else
      say "Nothing to do here. Bye!", :blue
    end
  when "contentful"
    if yes? "Warning: this will erase your Contentful data. Continue?", :yellow
      say "Exporting data to Contentful...", :blue
      Contentful.new.bootstrap!
    else
      say "Nothing to do here. Bye!", :blue
    end
  else
    say "coming soon...", :yellow
  end
end