Sha256: b3c6553ee3c46f8a7e946dc101149ee004c3ce0fc5e8734cbbc44ad032886dda

Contents?: true

Size: 904 Bytes

Versions: 3

Compression:

Stored size: 904 Bytes

Contents

require_relative "bootstrappers/datocms"
require_relative "bootstrappers/contentful"

module Commercelayer
  module CLI
    module Bootstrappers

      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

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
commercelayer-cli-0.2.5 lib/commercelayer/cli/bootstrappers.rb
commercelayer-cli-0.2.4 lib/commercelayer/cli/bootstrappers.rb
commercelayer-cli-0.2.3 lib/commercelayer/cli/bootstrappers.rb