Sha256: 8efb5ea3e710497078ae3c4f7b6fffa2f44be0596bebb46f0bbb647725136a5a

Contents?: true

Size: 771 Bytes

Versions: 11

Compression:

Stored size: 771 Bytes

Contents

module PDK::CLI
  @new_provider_cmd = @new_cmd.define_command do
    name 'provider'
    usage _('provider [options] <name>')
    summary _('[experimental] Create a new ruby provider named <name> using given options')

    PDK::CLI.template_url_option(self)

    run do |opts, args, _cmd|
      PDK::CLI::Util.ensure_in_module!

      provider_name = args[0]
      module_dir = Dir.pwd

      if provider_name.nil? || provider_name.empty?
        puts command.help
        exit 1
      end

      unless Util::OptionValidator.valid_provider_name?(provider_name)
        raise PDK::CLI::ExitWithError, _("'%{name}' is not a valid provider name") % { name: provider_name }
      end

      PDK::Generate::Provider.new(module_dir, provider_name, opts).run
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
pdk-akerl-1.9.1.1 lib/pdk/cli/new/provider.rb
pdk-1.9.1 lib/pdk/cli/new/provider.rb
pdk-1.9.0 lib/pdk/cli/new/provider.rb
pdk-akerl-1.8.0.1 lib/pdk/cli/new/provider.rb
pdk-1.8.0 lib/pdk/cli/new/provider.rb
pdk-1.7.1 lib/pdk/cli/new/provider.rb
pdk-1.7.0 lib/pdk/cli/new/provider.rb
pdk-1.6.1 lib/pdk/cli/new/provider.rb
pdk-1.6.0 lib/pdk/cli/new/provider.rb
pdk-1.5.0 lib/pdk/cli/new/provider.rb
pdk-1.4.1 lib/pdk/cli/new/provider.rb