diff --git a/cmd/kratos/internal/project/new.go b/cmd/kratos/internal/project/new.go index 73c01986c..b6318959c 100644 --- a/cmd/kratos/internal/project/new.go +++ b/cmd/kratos/internal/project/new.go @@ -16,6 +16,7 @@ import ( type Project struct { Name string Path string + Mod string } // New new a project from remote repo. @@ -39,7 +40,7 @@ func (p *Project) New(ctx context.Context, dir string, layout string, branch str } fmt.Printf("🚀 Creating service %s, layout repo is %s, please wait a moment.\n\n", p.Name, layout) repo := base.NewRepo(layout, branch) - if err := repo.CopyTo(ctx, to, p.Path, []string{".git", ".github"}); err != nil { + if err := repo.CopyTo(ctx, to, p.Mod, []string{".git", ".github"}); err != nil { return err } e := os.Rename( diff --git a/cmd/kratos/internal/project/project.go b/cmd/kratos/internal/project/project.go index 3e6eec1ee..a41ca4451 100644 --- a/cmd/kratos/internal/project/project.go +++ b/cmd/kratos/internal/project/project.go @@ -66,7 +66,7 @@ func run(_ *cobra.Command, args []string) { name = args[0] } projectName, workingDir := processProjectParams(name, wd) - p := &Project{Name: projectName, Path: projectName} + p := &Project{Name: projectName, Path: projectName, Mod: name} done := make(chan error, 1) go func() { if !nomod {