Skip to content

Commit

Permalink
fix(cli): correct non-interactive condition
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie-yang committed Jul 26, 2024
1 parent 13796a3 commit 6db8be4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cli-client/internals/cli/cli_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func addHelp(p *flags.Parser) {
func blockForConfirm(s string) error {
// check if is a tty
fi, err := os.Stdin.Stat()
if err != nil || fi.Mode()&os.ModeNamedPipe == 0 {
if err != nil && fi.Mode()&os.ModeNamedPipe == 1 {
return fmt.Errorf("non-interactive terminal detected, run with -y option")
} else if err != nil {
return err
Expand Down

0 comments on commit 6db8be4

Please sign in to comment.