Skip to content

Commit

Permalink
Prioritize fallback over non-interactive mode (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher authored Sep 29, 2023
1 parent 29ec41a commit 37ed55f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Prompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ abstract public function value(): mixed;
public function prompt(): mixed
{
try {
static::$interactive ??= stream_isatty(STDIN);

if (! static::$interactive) {
return $this->default();
}

$this->capturePreviousNewLines();

if (static::shouldFallback()) {
return $this->fallback();
}

static::$interactive ??= stream_isatty(STDIN);

if (! static::$interactive) {
return $this->default();
}

$this->checkEnvironment();

try {
Expand Down

0 comments on commit 37ed55f

Please sign in to comment.