Skip to content

Commit

Permalink
RSDK-9764 - fix special case of generics for user prompted modulegen (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stuqdog authored Jan 21, 2025
1 parent 4f2b707 commit 0c04844
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/module_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, " ")
}
Expand Down

0 comments on commit 0c04844

Please sign in to comment.