mirror of
https://github.com/maaslalani/confetty.git
synced 2024-11-21 23:26:40 +00:00
Smaller conditional
This commit is contained in:
parent
dcc0d58654
commit
1373a345bc
9
main.go
9
main.go
@ -11,13 +11,14 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var err error
|
var err error
|
||||||
|
var model tea.Model
|
||||||
if len(os.Args) > 1 && os.Args[1] == "fireworks" {
|
if len(os.Args) > 1 && os.Args[1] == "fireworks" {
|
||||||
p := tea.NewProgram(fireworks.InitialModel(), tea.WithAltScreen())
|
model = fireworks.InitialModel()
|
||||||
err = p.Start()
|
|
||||||
} else {
|
} else {
|
||||||
p := tea.NewProgram(confetti.InitialModel(), tea.WithAltScreen())
|
model = confetti.InitialModel()
|
||||||
err = p.Start()
|
|
||||||
}
|
}
|
||||||
|
p := tea.NewProgram(model, tea.WithAltScreen())
|
||||||
|
err = p.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user