Sha256: b1f1e40cd5e73957fa40ea2b2c9c81fae87c1cf6cc1404ab8169ed216df71ba2

Contents?: true

Size: 731 Bytes

Versions: 1

Compression:

Stored size: 731 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')

    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

1 entries across 1 versions & 1 rubygems

Version Path
pdk-1.10.0 lib/pdk/cli/new/provider.rb