From fbd18e2d7720567a6be49cda2e8280e62d400cb7 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sat, 2 Nov 2024 18:04:14 -0400 Subject: [PATCH 1/9] Spec out `default` config for select module types, when `prompt: false`. --- tests/StarterKits/InstallTest.php | 60 +++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/tests/StarterKits/InstallTest.php b/tests/StarterKits/InstallTest.php index 10c85e1c2e..4fcdb8832c 100644 --- a/tests/StarterKits/InstallTest.php +++ b/tests/StarterKits/InstallTest.php @@ -780,7 +780,7 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run ], 'modules' => [ 'seo' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively + 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed 'export_paths' => [ 'resources/css/seo.css', ], @@ -797,11 +797,39 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run ], ], 'jamaica' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively + 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed 'export_as' => [ 'resources/css/theme.css' => 'resources/css/jamaica.css', ], ], + 'js' => [ + 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed + 'default' => 'vue', // And a `default` is required so that we know which one to install + 'options' => [ + 'react' => [ + 'label' => 'React JS', + 'export_paths' => [ + 'resources/js/react.js', + ], + ], + 'vue' => [ + 'label' => 'Vue JS', + 'export_paths' => [ + 'resources/js/vue.js', + ], + ], + ], + ], + 'js_invalid' => [ + 'prompt' => false, // Setting prompt to false without a `default`, is not valid config + 'options' => [ + 'svelte' => [ + 'export_paths' => [ + 'resources/js/svelte.js', + ], + ], + ], + ], ], ]); @@ -811,6 +839,9 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run $this->assertFileDoesNotExist(base_path('resources/css/theme.css')); $this->assertComposerJsonDoesntHave('statamic/seo-pro'); $this->assertComposerJsonDoesntHave('bobsled/speed-calculator'); + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileDoesNotExist(base_path('resources/js/vue.js')); + $this->assertFileDoesNotExist(base_path('resources/js/svelte.js')); $this->installCoolRunnings(); @@ -820,6 +851,9 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run $this->assertFileExists(base_path('resources/css/theme.css')); $this->assertComposerJsonHasPackageVersion('require', 'statamic/seo-pro', '^0.2.0'); $this->assertComposerJsonDoesntHave('bobsled/speed-calculator'); + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileExists(base_path('resources/js/vue.js')); + $this->assertFileDoesNotExist(base_path('resources/js/svelte.js')); } #[Test] @@ -1179,6 +1213,24 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w 'resources/dictionaries/canadian_players.yaml', ], ], + 'js' => [ + 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed + 'default' => 'vue', // And a `default` is required so that we know which one to install + 'options' => [ + 'react' => [ + 'label' => 'React JS', + 'export_paths' => [ + 'resources/js/react.js', + ], + ], + 'vue' => [ + 'label' => 'Vue JS', + 'export_paths' => [ + 'resources/js/vue.js', + ], + ], + ], + ], ], ], ], @@ -1192,6 +1244,8 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w $this->assertFileDoesNotExist(base_path('resources/dictionaries/players.yaml')); $this->assertFileDoesNotExist(base_path('resources/dictionaries/american_players.yaml')); $this->assertFileDoesNotExist(base_path('resources/dictionaries/canadian_players.yaml')); + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileDoesNotExist(base_path('resources/js/vue.js')); $this->installCoolRunnings(); @@ -1201,6 +1255,8 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w $this->assertFileExists(base_path('resources/dictionaries/players.yaml')); $this->assertFileDoesNotExist(base_path('resources/dictionaries/american_players.yaml')); $this->assertFileExists(base_path('resources/dictionaries/canadian_players.yaml')); + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileExists(base_path('resources/js/vue.js')); } #[Test] From 30332e26edc8f8e524cffce9f8ddd3989bd990d9 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sat, 2 Nov 2024 18:30:11 -0400 Subject: [PATCH 2/9] Pass tests. --- src/StarterKits/Installer.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/StarterKits/Installer.php b/src/StarterKits/Installer.php index a17f8adfc3..a2e6b3d640 100644 --- a/src/StarterKits/Installer.php +++ b/src/StarterKits/Installer.php @@ -324,14 +324,14 @@ protected function instantiateModule(array $config, string $key): InstallableMod { $shouldPrompt = true; - if (Arr::has($config, 'options')) { - return $this->instantiateSelectModule($config, $key); - } - if (Arr::get($config, 'prompt') === false) { $shouldPrompt = false; } + if (Arr::has($config, 'options')) { + return $this->instantiateSelectModule($config, $key, $shouldPrompt); + } + $name = str_replace('_', ' ', $key); if ($shouldPrompt && $this->isInteractive && ! confirm(Arr::get($config, 'prompt', "Would you like to install the [{$name}] module?"), false)) { @@ -346,7 +346,7 @@ protected function instantiateModule(array $config, string $key): InstallableMod /** * Instantiate select module. */ - protected function instantiateSelectModule(array $config, string $key): InstallableModule|array|bool + protected function instantiateSelectModule(array $config, string $key, bool $shouldPrompt): InstallableModule|array|bool { $options = collect($config['options']) ->map(fn ($option, $optionKey) => Arr::get($option, 'label', ucfirst($optionKey))) @@ -355,10 +355,16 @@ protected function instantiateSelectModule(array $config, string $key): Installa $name = str_replace('_', ' ', $key); - $choice = select( - label: Arr::get($config, 'prompt', "Would you like to install one of the following [{$name}] modules?"), - options: $options, - ); + if ($shouldPrompt && $this->isInteractive) { + $choice = select( + label: Arr::get($config, 'prompt', "Would you like to install one of the following [{$name}] modules?"), + options: $options, + ); + } elseif ($shouldPrompt && ! $this->isInteractive) { + return false; + } elseif (! $shouldPrompt && ! $choice = Arr::get($config, 'default')) { + return false; + } if ($choice === $skipModule) { return false; From 3a04a8628448cbf9ad165928c651cb0c29c518a3 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sat, 2 Nov 2024 19:48:04 -0400 Subject: [PATCH 3/9] Tweak tests. --- tests/StarterKits/InstallTest.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/StarterKits/InstallTest.php b/tests/StarterKits/InstallTest.php index 4fcdb8832c..078bb6a96a 100644 --- a/tests/StarterKits/InstallTest.php +++ b/tests/StarterKits/InstallTest.php @@ -772,7 +772,7 @@ public function it_installs_no_modules_by_default_when_running_non_interactively } #[Test] - public function it_installs_modules_with_prompt_false_config_by_default_when_running_non_interactively() + public function it_can_still_install_modules_with_prompt_false_or_default_config() { $this->setConfig([ 'export_paths' => [ @@ -780,7 +780,7 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run ], 'modules' => [ 'seo' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed + 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed 'export_paths' => [ 'resources/css/seo.css', ], @@ -797,14 +797,13 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run ], ], 'jamaica' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed + 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed 'export_as' => [ 'resources/css/theme.css' => 'resources/css/jamaica.css', ], ], 'js' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed - 'default' => 'vue', // And a `default` is required so that we know which one to install + 'default' => 'vue', // Setting a `default` option, so this module should still get installed 'options' => [ 'react' => [ 'label' => 'React JS', @@ -821,7 +820,7 @@ public function it_installs_modules_with_prompt_false_config_by_default_when_run ], ], 'js_invalid' => [ - 'prompt' => false, // Setting prompt to false without a `default`, is not valid config + 'prompt' => false, // Setting `prompt: false` doesn't do anything for select modules, should use `default` like above 'options' => [ 'svelte' => [ 'export_paths' => [ @@ -1180,7 +1179,7 @@ public static function validModuleConfigs() } #[Test] - public function it_installs_nested_modules_with_prompt_false_config_by_default_when_running_non_interactively() + public function it_can_still_install_nested_modules_with_prompt_false_or_default_config() { $this->setConfig([ 'export_paths' => [ @@ -1188,13 +1187,13 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w ], 'modules' => [ 'canada' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively + 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed 'export_paths' => [ 'resources/css/hockey.css', ], 'modules' => [ 'hockey_players' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively + 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed 'export_paths' => [ 'resources/dictionaries/players.yaml', ], @@ -1208,14 +1207,13 @@ public function it_installs_nested_modules_with_prompt_false_config_by_default_w ], ], 'hockey_night_in_canada' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed non-interactively + 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed 'export_paths' => [ 'resources/dictionaries/canadian_players.yaml', ], ], 'js' => [ - 'prompt' => false, // Setting prompt to false skips confirmation, so this module should still get installed - 'default' => 'vue', // And a `default` is required so that we know which one to install + 'default' => 'vue', // Setting a `default` option, so this module should still get installed 'options' => [ 'react' => [ 'label' => 'React JS', From e8ffb6ba864fe830051cbe2a1ea124b855159694 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sat, 2 Nov 2024 19:48:17 -0400 Subject: [PATCH 4/9] Fix implementation to match updated PR description. --- src/StarterKits/Installer.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/StarterKits/Installer.php b/src/StarterKits/Installer.php index a2e6b3d640..fdb1e04c3a 100644 --- a/src/StarterKits/Installer.php +++ b/src/StarterKits/Installer.php @@ -324,12 +324,12 @@ protected function instantiateModule(array $config, string $key): InstallableMod { $shouldPrompt = true; - if (Arr::get($config, 'prompt') === false) { - $shouldPrompt = false; + if (Arr::has($config, 'options')) { + return $this->instantiateSelectModule($config, $key); } - if (Arr::has($config, 'options')) { - return $this->instantiateSelectModule($config, $key, $shouldPrompt); + if (Arr::get($config, 'prompt') === false) { + $shouldPrompt = false; } $name = str_replace('_', ' ', $key); @@ -346,27 +346,28 @@ protected function instantiateModule(array $config, string $key): InstallableMod /** * Instantiate select module. */ - protected function instantiateSelectModule(array $config, string $key, bool $shouldPrompt): InstallableModule|array|bool + protected function instantiateSelectModule(array $config, string $key): InstallableModule|array|bool { + $skipOptionLabel = Arr::get($config, 'skip_option', 'No'); + $skipModuleValue = 'skip_module'; + $options = collect($config['options']) ->map(fn ($option, $optionKey) => Arr::get($option, 'label', ucfirst($optionKey))) - ->prepend(Arr::get($config, 'skip_option', 'No'), $skipModule = 'skip_module') + ->when($skipOptionLabel !== false, fn ($c) => $c->prepend($skipOptionLabel, $skipModuleValue)) ->all(); $name = str_replace('_', ' ', $key); - if ($shouldPrompt && $this->isInteractive) { + if ($this->isInteractive) { $choice = select( label: Arr::get($config, 'prompt', "Would you like to install one of the following [{$name}] modules?"), options: $options, ); - } elseif ($shouldPrompt && ! $this->isInteractive) { - return false; - } elseif (! $shouldPrompt && ! $choice = Arr::get($config, 'default')) { + } elseif (! $this->isInteractive && ! $choice = Arr::get($config, 'default')) { return false; } - if ($choice === $skipModule) { + if ($choice === $skipModuleValue) { return false; } From 92139cf7ccf7495f1dc8e6ec0a2b60da3a7aea2e Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sat, 2 Nov 2024 19:58:59 -0400 Subject: [PATCH 5/9] Flesh out test coverage for new `skip_option: false` functionality. --- tests/StarterKits/InstallTest.php | 118 +++++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/tests/StarterKits/InstallTest.php b/tests/StarterKits/InstallTest.php index 078bb6a96a..b13a9eac88 100644 --- a/tests/StarterKits/InstallTest.php +++ b/tests/StarterKits/InstallTest.php @@ -959,7 +959,120 @@ public function it_installs_only_the_modules_confirmed_interactively_via_prompt( } #[Test] - public function it_display_custom_module_prompts() + public function it_allows_user_to_skip_in_select_module_prompts() + { + $this->setConfig([ + 'modules' => [ + 'js' => [ + 'prompt' => 'Want one of these fancy JS options?', + 'options' => [ + 'react' => [ + 'label' => 'React JS', + 'export_paths' => [ + 'resources/js/react.js', + ], + ], + 'vue' => [ + 'label' => 'Vue JS', + 'export_paths' => [ + 'resources/js/vue.js', + ], + ], + 'svelte' => [ + 'export_paths' => [ + 'resources/js/svelte.js', + ], + ], + ], + ], + ], + ]); + + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileDoesNotExist(base_path('resources/js/vue.js')); + $this->assertFileDoesNotExist(base_path('resources/js/svelte.js')); + + $command = $this->installCoolRunningsModules(); + + // Some fixes to `expectsChoice()` were merged for us, but are not available on 11.20.0 and below + // See: https://github.com/laravel/framework/pull/52408 + if (version_compare(app()->version(), '11.20.0', '>')) { + $command->expectsChoice('Want one of these fancy JS options?', 'skip_module', [ + 'skip_module' => 'No', + 'react' => 'React JS', + 'vue' => 'Vue JS', + 'svelte' => 'Svelte', + ]); + } else { + $command->expectsQuestion('Want one of these fancy JS options?', 'skip_module'); + } + + $command->run(); + + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileDoesNotExist(base_path('resources/js/vue.js')); + $this->assertFileDoesNotExist(base_path('resources/js/svelte.js')); + } + + #[Test] + public function it_can_disable_skip_option_in_select_module_prompts() + { + $this->setConfig([ + 'modules' => [ + 'js' => [ + 'prompt' => 'Want one of these fancy JS options?', + 'skip_option' => false, + 'options' => [ + 'react' => [ + 'label' => 'React JS', + 'export_paths' => [ + 'resources/js/react.js', + ], + ], + 'vue' => [ + 'label' => 'Vue JS', + 'export_paths' => [ + 'resources/js/vue.js', + ], + ], + 'svelte' => [ + 'export_paths' => [ + 'resources/js/svelte.js', + ], + ], + ], + ], + ], + ]); + + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileDoesNotExist(base_path('resources/js/vue.js')); + $this->assertFileDoesNotExist(base_path('resources/js/svelte.js')); + + $command = $this->installCoolRunningsModules(); + + // Some fixes to `expectsChoice()` were merged for us, but are not available on 11.20.0 and below + // See: https://github.com/laravel/framework/pull/52408 + if (version_compare(app()->version(), '11.20.0', '>')) { + $command->expectsChoice('Want one of these fancy JS options?', 'svelte', [ + // 'skip_module' => 'No', // This should not be here anymore, because of `skip_option: false` + 'react' => 'React JS', + 'vue' => 'Vue JS', + 'svelte' => 'Svelte', + ]); + } else { + $command->expectsQuestion('Want one of these fancy JS options?', 'svelte'); + } + + $command->run(); + + $this->assertFileDoesNotExist(base_path('resources/js/react.js')); + $this->assertFileDoesNotExist(base_path('resources/js/vue.js')); + $this->assertFileExists(base_path('resources/js/svelte.js')); + } + + #[Test] + public function it_display_custom_module_prompts_and_option_labels() { $this->setConfig([ 'modules' => [ @@ -971,6 +1084,7 @@ public function it_display_custom_module_prompts() ], 'js' => [ 'prompt' => 'Want one of these fancy JS options?', + 'skip_option' => 'No, thank you!', 'options' => [ 'react' => [ 'label' => 'React JS', @@ -1007,7 +1121,7 @@ public function it_display_custom_module_prompts() // See: https://github.com/laravel/framework/pull/52408 if (version_compare(app()->version(), '11.20.0', '>')) { $command->expectsChoice('Want one of these fancy JS options?', 'svelte', [ - 'skip_module' => 'No', + 'skip_module' => 'No, thank you!', 'react' => 'React JS', 'vue' => 'Vue JS', 'svelte' => 'Svelte', From 78716117a27bccff90c045fc3256ca0d24d82087 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Sun, 24 Nov 2024 18:25:38 -0500 Subject: [PATCH 6/9] Auto-select `default` value as well. --- src/StarterKits/Installer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/StarterKits/Installer.php b/src/StarterKits/Installer.php index fdb1e04c3a..125b66ce7c 100644 --- a/src/StarterKits/Installer.php +++ b/src/StarterKits/Installer.php @@ -362,6 +362,7 @@ protected function instantiateSelectModule(array $config, string $key): Installa $choice = select( label: Arr::get($config, 'prompt', "Would you like to install one of the following [{$name}] modules?"), options: $options, + default: Arr::get($config, 'default'), ); } elseif (! $this->isInteractive && ! $choice = Arr::get($config, 'default')) { return false; From 9b968479c5828e82e41f8fb83bb93ae14100dc17 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 26 Nov 2024 11:04:25 -0500 Subject: [PATCH 7/9] Fix `$default` handling on confirmation module. --- src/StarterKits/Installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/StarterKits/Installer.php b/src/StarterKits/Installer.php index 125b66ce7c..186291e433 100644 --- a/src/StarterKits/Installer.php +++ b/src/StarterKits/Installer.php @@ -334,7 +334,9 @@ protected function instantiateModule(array $config, string $key): InstallableMod $name = str_replace('_', ' ', $key); - if ($shouldPrompt && $this->isInteractive && ! confirm(Arr::get($config, 'prompt', "Would you like to install the [{$name}] module?"), false)) { + $default = Arr::get($config, 'default', false); + + if ($shouldPrompt && $this->isInteractive && ! confirm(Arr::get($config, 'prompt', "Would you like to install the [{$name}] module?"), $default)) { return false; } elseif ($shouldPrompt && ! $this->isInteractive) { return false; From 7b5df64047c7b2b5794ce8d938f898fbd4b5580e Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 26 Nov 2024 11:20:32 -0500 Subject: [PATCH 8/9] Add test coverage for `default: true` on confirmation non-interactively. --- tests/StarterKits/InstallTest.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/StarterKits/InstallTest.php b/tests/StarterKits/InstallTest.php index b13a9eac88..8303443d7c 100644 --- a/tests/StarterKits/InstallTest.php +++ b/tests/StarterKits/InstallTest.php @@ -780,7 +780,7 @@ public function it_can_still_install_modules_with_prompt_false_or_default_config ], 'modules' => [ 'seo' => [ - 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed + 'prompt' => false, // Setting `prompt: false` normally skips confirmation and ensures it always gets installed 'export_paths' => [ 'resources/css/seo.css', ], @@ -788,6 +788,12 @@ public function it_can_still_install_modules_with_prompt_false_or_default_config 'statamic/seo-pro' => '^0.2.0', ], ], + 'hockey' => [ + 'default' => true, // Setting `default: true` will still ask user for confirmation, but should still get installed non-interactively + 'export_paths' => [ + 'resources/css/hockey.css', + ], + ], 'bobsled' => [ 'export_paths' => [ 'resources/css/bobsled.css', @@ -797,13 +803,13 @@ public function it_can_still_install_modules_with_prompt_false_or_default_config ], ], 'jamaica' => [ - 'prompt' => false, // Setting `prompt: false` skips confirmation, so this module should still get installed + 'prompt' => false, // Setting `prompt: false` normally skips confirmation and ensures it always gets installed 'export_as' => [ 'resources/css/theme.css' => 'resources/css/jamaica.css', ], ], 'js' => [ - 'default' => 'vue', // Setting a `default` option, so this module should still get installed + 'default' => 'vue', // Setting a `default` option will still ask user for confirmation, but should still get installed non-interactively 'options' => [ 'react' => [ 'label' => 'React JS', @@ -834,6 +840,7 @@ public function it_can_still_install_modules_with_prompt_false_or_default_config $this->assertFileDoesNotExist(base_path('copied.md')); $this->assertFileDoesNotExist(base_path('resources/css/seo.css')); + $this->assertFileDoesNotExist(base_path('resources/css/hockey.css')); $this->assertFileDoesNotExist(base_path('resources/css/bobsled.css')); $this->assertFileDoesNotExist(base_path('resources/css/theme.css')); $this->assertComposerJsonDoesntHave('statamic/seo-pro'); @@ -846,6 +853,7 @@ public function it_can_still_install_modules_with_prompt_false_or_default_config $this->assertFileExists(base_path('copied.md')); $this->assertFileExists(base_path('resources/css/seo.css')); + $this->assertFileExists(base_path('resources/css/hockey.css')); $this->assertFileDoesNotExist(base_path('resources/css/bobsled.css')); $this->assertFileExists(base_path('resources/css/theme.css')); $this->assertComposerJsonHasPackageVersion('require', 'statamic/seo-pro', '^0.2.0'); From 98867da66dc0ec6fe4a31f7366c262524e2a6f15 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Tue, 26 Nov 2024 11:21:04 -0500 Subject: [PATCH 9/9] Pass test. --- src/StarterKits/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StarterKits/Installer.php b/src/StarterKits/Installer.php index 186291e433..d4ca503cc1 100644 --- a/src/StarterKits/Installer.php +++ b/src/StarterKits/Installer.php @@ -338,7 +338,7 @@ protected function instantiateModule(array $config, string $key): InstallableMod if ($shouldPrompt && $this->isInteractive && ! confirm(Arr::get($config, 'prompt', "Would you like to install the [{$name}] module?"), $default)) { return false; - } elseif ($shouldPrompt && ! $this->isInteractive) { + } elseif ($shouldPrompt && ! $this->isInteractive && ! $default) { return false; }