show project download info at UI side
@@ -911,7 +911,7 @@ func (co *CreateOptions) downloadProject(projectPassed string) error {
return err
}
- var url, sparseDir string
+ var logUrl, url, sparseDir string
if project.Git != nil {
if strings.Contains(project.Git.Location, "github.com") {
url, err = util.GetGitHubZipURL(project.Git.Location, project.Git.Branch, project.Git.StartPoint)
@@ -922,25 +922,32 @@ func (co *CreateOptions) downloadProject(projectPassed string) error {
} else {
return errors.Errorf("project type git with non github url not supported")
}
+ logUrl = project.Git.Location
} else if project.Github != nil {
url, err = util.GetGitHubZipURL(project.Github.Location, project.Github.Branch, project.Github.StartPoint)
if err != nil {
return err
}
+ logUrl = project.Github.Location
sparseDir = project.Github.SparseCheckoutDir
} else if project.Zip != nil {
url = project.Zip.Location
+ logUrl = project.Zip.Location
sparseDir = project.Zip.SparseCheckoutDir
} else {
return errors.Errorf("Project type not supported")
}
+ log.Info("\nProject")
+ downloadSpinner := log.Spinnerf("Downloading project from %s", logUrl)
err = checkoutProject(sparseDir, url, path)
if err != nil {
+ downloadSpinner.End(false)
return err
}
+ downloadSpinner.End(true)
return nil
}
