Skip to content

Commit 09f8e19

Browse files
authored
Merge pull request #292 from sharunkumar/patch-1
fix: generated plugin file name should be snake_case
2 parents feb8e68 + 6e8f548 commit 09f8e19

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/contrib/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ func newPlugin() error {
143143
CredentialNameUpperCamelCase string
144144
CredentialNameSnakeCase string
145145
TestCredentialExample string
146+
ExecutableSnakeCase string
146147
}{}
147148

148149
err := survey.Ask(questionnaire, &result)
@@ -170,6 +171,7 @@ func newPlugin() error {
170171

171172
result.CredentialNameUpperCamelCase = strings.Join(credNameSplit, "")
172173
result.CredentialNameSnakeCase = strings.ToLower(strings.Join(credNameSplit, "_"))
174+
result.ExecutableSnakeCase = strings.ToLower(strings.ReplaceAll(result.Executable, "-", "_"))
173175

174176
result.IsNewCredentialName = true
175177
for _, existing := range credname.ListAll() {
@@ -488,7 +490,7 @@ func Test{{ .CredentialNameUpperCamelCase }}Importer(t *testing.T) {
488490
}
489491

490492
var executableTemplate = Template{
491-
Filename: "{{ .Executable }}.go",
493+
Filename: "{{ .ExecutableSnakeCase }}.go",
492494
Contents: `package {{ .Name }}
493495
494496
import (

0 commit comments

Comments
 (0)