Skip to content

Commit

Permalink
Fix empty type support in init command, fixes #11999
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jun 10, 2024
1 parent ee2c9af commit 137ec17
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Composer/Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,14 @@ static function ($value) use ($minimumStability) {
);
$input->setOption('stability', $minimumStability);

$type = $input->getOption('type') ?: false;
$type = $input->getOption('type');
$type = $io->ask(
'Package Type (e.g. library, project, metapackage, composer-plugin) [<comment>'.$type.'</comment>]: ',
$type
);
if ($type === '' || $type === false) {
$type = null;
}
$input->setOption('type', $type);

if (null === $license = $input->getOption('license')) {
Expand Down

0 comments on commit 137ec17

Please sign in to comment.