Hide cursor and fix dots (#217)

* Hide cursor and fix dots spinner

* Allow restarting of spinner

* Don't spin on non TTY output

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-10-21 14:26:42 +02:00 committed by GitHub
parent 56981a709e
commit c82d5ccba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 118 additions and 102 deletions

View file

@ -41,9 +41,9 @@ func NewCreateCmd() *cobra.Command {
func runCreate(cmd *cobra.Command, args []string) error {
fileHandler := file.NewHandler(afero.NewOsFs())
spinner, writer := newSpinner(cmd, cmd.OutOrStdout())
spinner := newSpinner(cmd.OutOrStdout())
defer spinner.Stop()
creator := cloudcmd.NewCreator(writer)
creator := cloudcmd.NewCreator(spinner)
return create(cmd, creator, fileHandler, spinner)
}