From 50c3835a38cadacff1302ce2aea46d47af403792 Mon Sep 17 00:00:00 2001 From: Garrett Rowell Date: Wed, 8 May 2024 12:38:23 -0400 Subject: [PATCH] allow controlrepos to be named whatever --- lib/pdk/module/convert.rb | 2 +- lib/pdk/module/metadata.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pdk/module/convert.rb b/lib/pdk/module/convert.rb index 388fc1456..4ec3c2889 100644 --- a/lib/pdk/module/convert.rb +++ b/lib/pdk/module/convert.rb @@ -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] diff --git a/lib/pdk/module/metadata.rb b/lib/pdk/module/metadata.rb index cf4c1f2de..2cf1c2c67 100644 --- a/lib/pdk/module/metadata.rb +++ b/lib/pdk/module/metadata.rb @@ -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('-')