Skip to content

Commit

Permalink
fix: use directory instead of project name when directory is set
Browse files Browse the repository at this point in the history
  • Loading branch information
mukezhz committed Jan 9, 2024
1 parent d570b31 commit d91c09f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/add_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ func addInfrastructure(
templatePath := filepath.Join(".", "templates", "wesionary", "infrastructure", infrasTmpl[i])
var targetRoot string
if isNewProject {
targetRoot = filepath.Join(data.PackageName, "pkg", "infrastructure", strings.Replace(infrasTmpl[i], ".tmpl", ".go", 1))
if data.Directory == "" {
targetRoot = filepath.Join(data.PackageName, "pkg", "infrastructure", strings.Replace(infrasTmpl[i], ".tmpl", ".go", 1))
} else {
targetRoot = filepath.Join(data.Directory, "pkg", "infrastructure", strings.Replace(infrasTmpl[i], ".tmpl", ".go", 1))
}
} else {
targetRoot = filepath.Join(".", "pkg", "infrastructure", strings.Replace(infrasTmpl[i], ".tmpl", ".go", 1))
}
Expand Down

0 comments on commit d91c09f

Please sign in to comment.