Smaller conditional

This commit is contained in:
Maas Lalani 2021-11-02 21:38:04 -04:00
parent dcc0d58654
commit 1373a345bc
No known key found for this signature in database
GPG Key ID: F53774FA051C052A

View File

@ -11,13 +11,14 @@ import (
func main() {
var err error
var model tea.Model
if len(os.Args) > 1 && os.Args[1] == "fireworks" {
p := tea.NewProgram(fireworks.InitialModel(), tea.WithAltScreen())
err = p.Start()
model = fireworks.InitialModel()
} else {
p := tea.NewProgram(confetti.InitialModel(), tea.WithAltScreen())
err = p.Start()
model = confetti.InitialModel()
}
p := tea.NewProgram(model, tea.WithAltScreen())
err = p.Start()
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)