We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f9f7bb commit 3947a39Copy full SHA for 3947a39
src/Sprout/Prompt.php
@@ -79,7 +79,9 @@ public function ask()
79
return [];
80
}
81
82
- $this->answers[$prompt['name']] = $answer;
+ if (isset($prompt['name'])) {
83
+ $this->answers[$prompt['name']] = $answer;
84
+ }
85
86
87
if ($this->singlePrompt) {
@@ -210,7 +212,7 @@ protected function renderTextPrompt($prompt, $rerender = true)
210
212
return;
211
213
214
- $output = $this->currentInput ?: "\033[90m{$prompt['default']}\033[0m";
215
+ $output = $this->currentInput ?: (isset($prompt['default']) ? "\033[90m{$prompt['default']}\033[0m" : '');
216
217
sprout()->style()->write(
218
"\033[36m?\033[0m \033[1;1m{$prompt['message']}:\033[0m \033[90m›\033[0m $output" . PHP_EOL
0 commit comments