mirror of https://github.com/databricks/cli.git
Add spinner when downloading templates for bundle init (#1188)
## Changes Templates can take a long time to download. This PR adds a spinner to give feedback to users. ## Tests <!-- How is this tested? --> Manually https://github.com/databricks/cli/assets/88374338/b453982c-3233-40f4-8d6f-f31606ff0195
This commit is contained in:
parent
a835a3e564
commit
d638262665
|
@ -191,12 +191,19 @@ See https://docs.databricks.com/en/dev-tools/bundles/templates.html for more inf
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// start the spinner
|
||||||
|
promptSpinner := cmdio.Spinner(ctx)
|
||||||
|
promptSpinner <- "Downloading the template\n"
|
||||||
|
|
||||||
// TODO: Add automated test that the downloaded git repo is cleaned up.
|
// TODO: Add automated test that the downloaded git repo is cleaned up.
|
||||||
// Clone the repository in the temporary directory
|
// Clone the repository in the temporary directory
|
||||||
err = git.Clone(ctx, templatePath, ref, repoDir)
|
err = git.Clone(ctx, templatePath, ref, repoDir)
|
||||||
|
close(promptSpinner)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up downloaded repository once the template is materialized.
|
// Clean up downloaded repository once the template is materialized.
|
||||||
defer os.RemoveAll(repoDir)
|
defer os.RemoveAll(repoDir)
|
||||||
return template.Materialize(ctx, configFile, filepath.Join(repoDir, templateDir), outputDir)
|
return template.Materialize(ctx, configFile, filepath.Join(repoDir, templateDir), outputDir)
|
||||||
|
|
Loading…
Reference in New Issue