Skip to content

Commit

Permalink
Merge pull request #63 from rodjek/sdk-262
Browse files Browse the repository at this point in the history
(SDK-262) Populate default metadata to match interview defaults
  • Loading branch information
DavidS committed Jun 6, 2017
2 parents 505b21e + a87e0b4 commit f505c9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/pdk/generators/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class Module

def self.invoke(opts={})
defaults = {
'name' => "#{Etc.getlogin}-#{opts[:name]}",
'version' => '0.1.0',
'dependencies' => [
{ 'name' => 'puppetlabs-stdlib', 'version_requirement' => '>= 1.0.0' }
]
],
}

defaults['license'] = opts[:license] if opts.has_key? :license
Expand Down Expand Up @@ -81,7 +82,7 @@ def self.module_interview(metadata, opts={})

begin
puts ""
forge_user = PDK::CLI::Input.get(_("What is your Puppet Forge username?"), Etc.getlogin)
forge_user = PDK::CLI::Input.get(_("What is your Puppet Forge username?"), metadata.data['author'])
metadata.update!('name' => "#{forge_user}-#{opts[:name]}")
rescue StandardError => e
PDK.logger.error(_("We're sorry, we could not parse your module name: %{message}") % {:message => e.message})
Expand Down
2 changes: 1 addition & 1 deletion lib/pdk/module/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Metadata
'name' => nil,
'version' => nil,
'author' => nil,
'summary' => nil,
'summary' => '',
'license' => 'Apache-2.0',
'source' => '',
'project_page' => nil,
Expand Down

0 comments on commit f505c9f

Please sign in to comment.