Skip to content

Commit

Permalink
misc: set input on mascot animation
Browse files Browse the repository at this point in the history
  • Loading branch information
nervo committed May 28, 2024
1 parent 544598b commit 97830ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/mascot/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewCmd() *cobra.Command {
Use: "duck",
Hidden: true,
RunE: func(cmd *cobra.Command, _ []string) error {
return run(cmd.OutOrStdout(), repeat)
return run(cmd.InOrStdin(), cmd.OutOrStdout(), repeat)
},
}

Expand All @@ -37,7 +37,7 @@ var (
audioYell []byte
)

func run(out io.Writer, repeat int) error {
func run(in io.Reader, out io.Writer, repeat int) error {
renderer := lipgloss.NewRenderer(out)

model, err := tea.NewProgram(
Expand All @@ -53,6 +53,7 @@ func run(out io.Writer, repeat int) error {
FrameYell: &frameYell,
AudioYell: &audioYell,
},
tea.WithInput(in),
tea.WithOutput(out),
tea.WithAltScreen(),
).Run()
Expand Down

0 comments on commit 97830ab

Please sign in to comment.