Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
install feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Mar 19, 2024
1 parent 8380325 commit 47285b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/sst/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ var Root = Command{
return err
}

spin := spinner.New(spinner.CharSets[14], 100*time.Millisecond)
defer spin.Stop()
spin.Suffix = " Installing providers..."
spin.Start()
if !p.CheckPlatform(version) {
err := p.CopyPlatform(version)
if err != nil {
Expand All @@ -534,7 +538,8 @@ var Root = Command{
if err != nil {
return err
}

spin.Stop()
ui.Success("Installed providers")
return nil
},
},
Expand Down
12 changes: 11 additions & 1 deletion cmd/sst/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (

const (
IconX = "×"
IconCheck = ""
IconCheck = ""
)

type UI struct {
Expand Down Expand Up @@ -570,3 +570,13 @@ func (u *UI) printProgress(progress Progress) {
fmt.Println()
u.hasProgress = true
}

func Success(msg string) {
color.New(color.FgGreen).Print(IconCheck + " ")
color.New(color.FgWhite).Println(msg)
}

func Error(msg string) {
color.New(color.FgRed).Print(IconX + " ")
color.New(color.FgWhite).Println(msg)
}

0 comments on commit 47285b5

Please sign in to comment.