lib/pdk/generate/module.rb in pdk-1.10.0 vs lib/pdk/generate/module.rb in pdk-1.11.0
- old
+ new
@@ -122,11 +122,11 @@
defaults = PDK::Module::Metadata::DEFAULTS.dup
defaults['name'] = "#{opts[:username]}-#{opts[:module_name]}" unless opts[:module_name].nil?
defaults['author'] = PDK.answers['author'] unless PDK.answers['author'].nil?
defaults['license'] = PDK.answers['license'] unless PDK.answers['license'].nil?
- defaults['license'] = opts[:license] if opts.key? :license
+ defaults['license'] = opts[:license] if opts.key?(:license)
metadata = PDK::Module::Metadata.new(defaults)
module_interview(metadata, opts) unless opts[:'skip-interview']
metadata
@@ -197,10 +197,11 @@
{
name: 'operatingsystem_support',
question: _('What operating systems does this module support?'),
help: _('Use the up and down keys to move between the choices, space to select and enter to continue.'),
required: true,
+ type: :multi_select,
choices: PDK::Module::Metadata::OPERATING_SYSTEMS,
default: PDK::Module::Metadata::DEFAULT_OPERATING_SYSTEMS.map do |os_name|
# tty-prompt uses a 1-index
PDK::Module::Metadata::OPERATING_SYSTEMS.keys.index(os_name) + 1
end,
@@ -250,10 +251,10 @@
end
end
else
questions.reject! { |q| q[:name] == 'module_name' } if opts.key?(:module_name)
questions.reject! { |q| q[:name] == 'license' } if opts.key?(:license)
- questions.reject! { |q| q[:forge_only] } unless opts.key?(:'full-interview')
+ questions.reject! { |q| q[:forge_only] } unless opts[:'full-interview']
end
interview.add_questions(questions)
action = File.file?('metadata.json') ? _('update') : _('create')