Skip to content

Commit

Permalink
[TASK] Better UX for make command
Browse files Browse the repository at this point in the history
(cherry picked from commit cd56ae8)
  • Loading branch information
nhovratov committed Sep 11, 2024
1 parent 266f2d9 commit ce38adb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Classes/Command/CreateContentBlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($rootVendor !== '') {
$default = $rootVendor;
}
$contentBlockVendorQuestion = new Question('Enter your vendor name (lowercase, separated by dashes "-")', $default);
$contentBlockVendorQuestion = new Question('Define vendor (<comment>vendor-name</comment>/content-block-name)', $default);
$contentBlockVendorQuestion->setValidator($this->validateName(...));
while (($vendor = $io->askQuestion($contentBlockVendorQuestion)) === false) {
$output->writeln('<error>Your vendor name does not match the requirement.</error>');
$output->writeln('<error>Your vendor name does not match the requirements.</error>');
}
}
$vendor = strtolower($vendor);
if ($input->getOption('name')) {
$name = $input->getOption('name');
if (!ContentBlockNameValidator::isValid($name)) {
$output->writeln('<error>Your Content Block name does not match the requirement.</error>');
$output->writeln('<error>Your Content Block name does not match the requirements.</error>');
return Command::INVALID;
}
} else {
$contentBlockNameQuestion = new Question('Enter your ' . $contentType->getHumanReadable() . ' name (lowercase, separated by dashes "-")');
$contentBlockNameQuestion = new Question('Define name (' . $vendor . '/<comment>content-block-name</comment>)');
$contentBlockNameQuestion->setValidator($this->validateName(...));
while (($name = $io->askQuestion($contentBlockNameQuestion)) === false) {
$output->writeln('<error>Your Content Block name does not match the requirement.</error>');
Expand Down Expand Up @@ -169,7 +169,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$title = $input->getOption('title');
} else {
$defaultTitle = $vendor . '/' . $name;
$question = new Question('Enter human-readable title', $defaultTitle);
$question = new Question('Define title', $defaultTitle);
$title = $io->askQuestion($question);
}

Expand Down

0 comments on commit ce38adb

Please sign in to comment.