Skip to content

Commit 7a4e732

Browse files
committed
[BUGFIX] Handle user sends EOF to disable interactive mode
Fixes: #457
1 parent 6427b5d commit 7a4e732

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Classes/Command/CreateContentBlockCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
namespace TYPO3\CMS\ContentBlocks\Command;
1919

2020
use Symfony\Component\Console\Command\Command;
21+
use Symfony\Component\Console\Exception\MissingInputException;
2122
use Symfony\Component\Console\Input\InputInterface;
2223
use Symfony\Component\Console\Input\InputOption;
2324
use Symfony\Component\Console\Output\OutputInterface;
@@ -170,6 +171,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
170171
$output->writeln('<error>Your Content Block name does not match the requirement.</error>');
171172
}
172173
}
174+
if ($name === null) {
175+
throw new MissingInputException('Aborted.', 1764341182);
176+
}
173177
$name = strtolower($name);
174178
if ($contentType === ContentType::PAGE_TYPE) {
175179
if ($typeName === null) {
@@ -234,6 +238,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
234238
}
235239
$availablePackageTitles = $this->getPackageTitles($availablePackagesForDisplay);
236240
$extension = $io->askQuestion(new ChoiceQuestion('Choose an extension in which the Content Block should be stored', $availablePackageTitles, $defaults['extension']));
241+
if ($extension === null) {
242+
throw new MissingInputException('Aborted.', 1764341183);
243+
}
237244
}
238245

239246
$contentBlockConfiguration = new LoadedContentBlock(

0 commit comments

Comments
 (0)