Sha256: 32e227a78bc758ddeb235b9f07cf67a98f77eeb92dcf60028309acc8fcc77087

Contents?: true

Size: 679 Bytes

Versions: 11

Compression:

Stored size: 679 Bytes

Contents

# frozen_string_literal: true
require 'thor'
require 'dato/dump/runner'

module Dato
  module Dump
    class Cli < Thor
      package_name 'DatoCMS'

      desc 'dump', 'dumps DatoCMS contents into local files'
      option :config, default: 'dato.config.rb'
      option :token, default: ENV['DATO_API_TOKEN'], required: true
      def dump
        config_file = File.expand_path(options[:config])

        client = Dato::Site::Client.new(
          options[:token],
          extra_headers: {
            'X-Reason' => 'dump',
            'X-SSG' => SsgDetector.new(Dir.pwd).detect
          }
        )

        Runner.new(config_file, client).run
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dato-0.1.31 lib/dato/dump/cli.rb
dato-0.1.30 lib/dato/dump/cli.rb
dato-0.1.29 lib/dato/dump/cli.rb
dato-0.1.28 lib/dato/dump/cli.rb
dato-0.1.27 lib/dato/dump/cli.rb
dato-0.1.26 lib/dato/dump/cli.rb
dato-0.1.25 lib/dato/dump/cli.rb
dato-0.1.24 lib/dato/dump/cli.rb
dato-0.1.23 lib/dato/dump/cli.rb
dato-0.1.22 lib/dato/dump/cli.rb
dato-0.1.21 lib/dato/dump/cli.rb