mirror of
https://github.com/charmbracelet/gum
synced 2024-06-03 06:12:19 +02:00
02e925ea57
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
22 lines
495 B
Go
22 lines
495 B
Go
package spin
|
|
|
|
import (
|
|
"github.com/charmbracelet/bubbles/spinner"
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
// Run provides a shell script interface for the spinner bubble.
|
|
// https://github.com/charmbracelet/bubbles/spinner
|
|
func (o Options) Run() {
|
|
s := spinner.New()
|
|
s.Style = o.SpinnerStyle.ToLipgloss()
|
|
s.Spinner = spinnerMap[o.Spinner]
|
|
m := model{
|
|
spinner: s,
|
|
title: o.TitleStyle.ToLipgloss().Render(o.Title),
|
|
command: o.Command,
|
|
}
|
|
p := tea.NewProgram(m)
|
|
_ = p.Start()
|
|
}
|