Skip to content

Commit

Permalink
Merge pull request #292 from sharunkumar/patch-1
Browse files Browse the repository at this point in the history
fix: generated plugin file name should be snake_case
  • Loading branch information
jpcoenen authored Jun 27, 2023
2 parents feb8e68 + 6e8f548 commit 09f8e19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/contrib/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func newPlugin() error {
CredentialNameUpperCamelCase string
CredentialNameSnakeCase string
TestCredentialExample string
ExecutableSnakeCase string
}{}

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

result.CredentialNameUpperCamelCase = strings.Join(credNameSplit, "")
result.CredentialNameSnakeCase = strings.ToLower(strings.Join(credNameSplit, "_"))
result.ExecutableSnakeCase = strings.ToLower(strings.ReplaceAll(result.Executable, "-", "_"))

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

var executableTemplate = Template{
Filename: "{{ .Executable }}.go",
Filename: "{{ .ExecutableSnakeCase }}.go",
Contents: `package {{ .Name }}
import (
Expand Down

0 comments on commit 09f8e19

Please sign in to comment.