Skip to content

Commit 304a0b2

Browse files
Ask yes/no question before showing first-party addons multiselect (#75)
1 parent 3560798 commit 304a0b2

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/NewCommand.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,27 @@ protected function askToInstallAddons()
571571
return $this;
572572
}
573573

574-
$this->addons = multiselect('Would you like to install any first-party addons?', [
575-
'collaboration' => 'Collaboration',
576-
'eloquent-driver' => 'Eloquent Driver',
577-
'ssg' => 'Static Site Generator',
578-
]);
574+
$choice = select(
575+
label: 'Would you like to install any first-party addons?',
576+
options: [
577+
$withoutAddonsOption = "No, I'm good for now.",
578+
"Yes, let me pick.",
579+
],
580+
);
581+
582+
if ($choice === $withoutAddonsOption) {
583+
return $this;
584+
}
585+
586+
$this->addons = multiselect(
587+
label: 'Which first-party addons do you want to install?',
588+
options: [
589+
'collaboration' => 'Collaboration',
590+
'eloquent-driver' => 'Eloquent Driver',
591+
'ssg' => 'Static Site Generator',
592+
],
593+
hint: 'Use the space bar to select options.'
594+
);
579595

580596
if (count($this->addons) > 0) {
581597
$this->output->write(" Great. We'll get these installed right after we setup your Statamic site.".PHP_EOL.PHP_EOL);

0 commit comments

Comments
 (0)