|
|
|
@ -15,6 +15,7 @@ import ( |
|
|
|
|
// Project is a project template.
|
|
|
|
|
type Project struct { |
|
|
|
|
Name string |
|
|
|
|
Path string |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// New new a project from remote repo.
|
|
|
|
@ -36,7 +37,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.Name, []string{".git", ".github"}); err != nil { |
|
|
|
|
if err := repo.CopyTo(ctx, to, p.Path, []string{".git", ".github"}); err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
os.Rename( |
|
|
|
|