Skip to content

Commit

Permalink
fix: rebase on main
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Dec 17, 2024
1 parent f9fa23b commit a4d325a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion confirm/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var errNotConfirmed = errors.New("not confirmed")
// Run provides a shell script interface for prompting a user to confirm an
// action with an affirmative or negative answer.
func (o Options) Run() error {
line, err := stdin.ReadLine()
line, err := stdin.Read(stdin.SingleLine(true))
if err == nil {
switch line {
case "yes", "y":
Expand Down
5 changes: 1 addition & 4 deletions internal/stdin/stdin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package stdin

import (
"bufio"
"errors"
"fmt"
"io"
"os"
Expand All @@ -11,8 +10,6 @@ import (
"github.com/charmbracelet/x/ansi"
)

var ErrEmpty = errors.New("stdin is empty")

type options struct {
ansiStrip bool
singleLine bool
Expand All @@ -38,7 +35,7 @@ func SingleLine(b bool) Option {
// Read reads input from an stdin pipe.
func Read(opts ...Option) (string, error) {
if IsEmpty() {
return "", ErrEmpty
return "", fmt.Errorf("stdin is empty")
}

options := options{}
Expand Down

0 comments on commit a4d325a

Please sign in to comment.