Skip to content

Commit

Permalink
[chore] [mdatagen] Don't guess package name for generated files
Browse files Browse the repository at this point in the history
Use the real package name. Composing the name doesn't match the reality for extensions
  • Loading branch information
dmitryax committed Feb 29, 2024
1 parent 89c6207 commit ab159b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/mdatagen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func run(ymlPath string) error {
}

ymlDir := filepath.Dir(ymlPath)
packageName := filepath.Base(ymlDir)

md, err := loadMetadata(ymlPath)
if err != nil {
Expand Down Expand Up @@ -75,7 +76,7 @@ func run(ymlPath string) error {

if md.Tests != nil {
if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"),
filepath.Join(ymlDir, "generated_component_test.go"), md, md.ShortFolderName+md.Status.Class); err != nil {
filepath.Join(ymlDir, "generated_component_test.go"), md, packageName); err != nil {
return err
}
}
Expand Down

0 comments on commit ab159b5

Please sign in to comment.