From 0c0484413389a73c4239df366ff00f4dfbc6e90a Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 21 Jan 2025 10:11:20 -0500 Subject: [PATCH] RSDK-9764 - fix special case of generics for user prompted modulegen (#4728) --- cli/module_generate.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/module_generate.go b/cli/module_generate.go index 1c0097890e6..a94a0dabe92 100644 --- a/cli/module_generate.go +++ b/cli/module_generate.go @@ -207,10 +207,14 @@ func promptUser(module *modulegen.ModuleInputs) error { } // we differentiate generic-service and generic-component in `modulegen.Resources` // but they still have the type listed. This carveout prevents the user prompt from - // suggesting `Generic Component Component` or `Generic Service Service` as an option + // suggesting `Generic Component Component` or `Generic Service Service` as an option, + // either visually or under the hood var resType string if words[0] == "Generic" { resType = strings.Join(words[:2], " ") + // specific carveout to ensure that the `resource` is either `generic service` or + // `generic component`, as opposed to `generic_service service` + resource = strings.ToLower(resType) } else { resType = strings.Join(words, " ") }