Sha256: 68492a2038691de0c0a77f74770c152cf97d0450062d8f47de640a6d7c258737

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby

require 'escort'
require_relative '../lib/cli'

fail ArgumentError, 'Set the path to the configuration file and define an action. More information can be found in the README.' if ARGF.argv.empty?
fail ArgumentError, "Missing '--config-file' argument. Usage: 'drupal-exporter --config-file PATH_TO_CONFIGURATION_FILE --action'." unless ARGV.include?('--config-file')

Escort::App.create do |app|
  app.summary 'Executable file of Drupal exporter'

  app.options do |opts|
    opts.opt :file, '--config-file', :short => '-f', :long => '--config-file', :type => :string

    app.command '--extract-to-json' do |command|
      command.summary 'Extract data from Drupal database dump file and save as JSON files'
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end

    app.command '--create-contentful-model-from-json' do |command|
      command.summary 'Create content types files, based on contentful structure json file.'
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end

    app.command '--convert-content-model-to-json' do |command|
      command.summary 'Transform content_model file into contentful_structure import form. View README'
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
drupal-exporter-0.0.1 bin/drupal-exporter