Skip to content

Commit 86b9053

Browse files
committed
Fix: Default input
1 parent 039af24 commit 86b9053

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jblond/cli/Cli.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ public function input(string $prompt, $validInputs, string $default = ''): strin
3333
)
3434
){
3535
echo $prompt;
36-
$input = trim(fgets(fopen('php://stdin', 'rb')));
3736
if(empty($input) && !empty($default)) {
3837
$input = $default;
3938
}
39+
else
40+
{
41+
$input = trim(fgets(fopen('php://stdin', 'rb')));
42+
}
4043
}
4144
return $input;
4245
}

0 commit comments

Comments
 (0)