Skip to content

Commit

Permalink
feat: improve speed to clone layout (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq authored May 13, 2022
1 parent 345b797 commit 7e25d6a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/jupiter/internal/cmd/cmd_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func generate(c *cli.Context, cmd string) error {
Comments: []string{
// "run to compile......",
fmt.Sprintf("Generate %s project success", cmd),
"\ncd " + filepath.Join(goDir),
"\ncd " + goDir,
"\njupiter run -c cmd/exampleserver/.jupiter.toml",
"\nEnjoy coding~~",
},
Expand Down Expand Up @@ -208,13 +208,9 @@ func getFileInfosByGit(name string) (
finalTemplateDir := "local_temp_jupiter_layout"
fmt.Println("git", "clone", gitPath)

cmd := exec.Command("git", "clone", gitPath, finalTemplateDir)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd := exec.Command("git", "clone", gitPath, finalTemplateDir, "-b", "main", "--depth=1")
if err := cmd.Run(); err != nil {
fmt.Printf("[jupiter] Clone template git codebase failed:template_name=[%v] gitPath=[%v] err=[%v]",
name, gitPath, err)
return fileInfos
panic(err)
}

// 获取模板的文件流
Expand Down

0 comments on commit 7e25d6a

Please sign in to comment.