-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.go
59 lines (53 loc) · 1.24 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package taskin
import (
"github.com/charmbracelet/bubbles/progress"
"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/lipgloss"
)
type Config struct {
Options ConfigOptions
Spinner spinner.Spinner
Colors ConfigColors
ProgressOptions []progress.Option
Chars ConfigChars
}
type ConfigOptions struct {
ExitOnFailure bool
}
type ConfigColors struct {
Spinner lipgloss.Color
Pending lipgloss.Color
Success lipgloss.Color
Failure lipgloss.Color
ParentStarted lipgloss.Color
}
type ConfigChars struct {
ParentStarted string
NotStarted string
Success string
Failure string
}
var Defaults = Config{
Options: ConfigOptions{
ExitOnFailure: true,
},
Spinner: spinner.Dot,
ProgressOptions: []progress.Option{
progress.WithDefaultGradient(),
progress.WithoutPercentage(),
progress.WithWidth(10),
},
Colors: ConfigColors{
Spinner: lipgloss.Color("214"),
Pending: lipgloss.Color("lightgrey"),
Success: lipgloss.Color("46"),
Failure: lipgloss.Color("196"),
ParentStarted: lipgloss.Color("214"),
},
Chars: ConfigChars{
ParentStarted: "»",
NotStarted: "•",
Success: "✔",
Failure: "✘",
},
}