CloneRepo clones a repo into the specified location.
(stagePath string, repo string)
| 30 | |
| 31 | // CloneRepo clones a repo into the specified location. |
| 32 | func CloneRepo(stagePath string, repo string) string { |
| 33 | org := utils.GetEnv("ORG_OVERRIDE", "catppuccin") |
| 34 | gitProgress := GitProgress{ |
| 35 | Progress: 0, |
| 36 | } |
| 37 | _, err := git.PlainClone(stagePath, false, &git.CloneOptions{ |
| 38 | URL: fmt.Sprintf("https://github.com/%s/%s.git", org, repo), |
| 39 | Progress: gitProgress, |
| 40 | }) |
| 41 | if err != nil { |
| 42 | // fmt.Println(err) |
| 43 | log.WithError(err).Error("failed to clone repo") |
| 44 | |
| 45 | } |
| 46 | return stagePath |
| 47 | } |
| 48 | |
| 49 | func StartClone(repo string) tea.Cmd { |
| 50 | return func() tea.Msg { |
no test coverage detected