Skip to content

Commit

Permalink
allow controlrepos to be named whatever (#1352)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettrowell authored Jul 9, 2024
1 parent dcd5fe2 commit 3f0ca66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pdk/module/convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def update_metadata(metadata_path, template_metadata)
return if options[:noop]

project_dir = File.basename(Dir.pwd)
options[:module_name] = project_dir.split('-', 2).compact[-1]
options[:module_name] = PDK.context.is_a?(PDK::Context::ControlRepo) ? project_dir : project_dir.split('-', 2).compact[-1]
options[:prompt] = false
options[:'skip-interview'] = true if options[:force]

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 @@ -162,7 +162,7 @@ def missing_fields

# Do basic validation and parsing of the name parameter.
def process_name(data)
validate_name(data['name'])
validate_name(data['name']) unless PDK.context.is_a?(PDK::Context::ControlRepo)
author, modname = data['name'].split(%r{[-/]}, 2)
data['name'] = [author, modname].join('-')

Expand Down

0 comments on commit 3f0ca66

Please sign in to comment.