Skip to content

Commit afbd774

Browse files
authored
fix(dev): new-component command (#8629)
fix(dev): new component command
1 parent 67d0372 commit afbd774

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

dev/src/Command/NewComponentCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
100100
$new = NewComponent::fromProto($this->loadProtoContent($proto), $protoFile);
101101
$new->componentPath = $this->rootPath;
102102

103-
$existingComponent = null;
104-
if ($components = Component::getComponents([$new->componentName])) {
103+
if (is_dir($this->rootPath . '/' . $new->componentName)) {
105104
// component already exists
106-
$existingComponent = array_pop($components);
107105
$output->writeln(''); // blank line
108106
if (!$this->getHelper('question')->ask($input, $output, new ConfirmationQuestion(
109-
sprintf('Component %s already exists. Overwrite it? [Y/n]', $existingComponent->getName()),
107+
sprintf('Component %s already exists. Overwrite it? [Y/n]', $new->componentName),
110108
'Y'
111109
))) {
112110
return 0;

0 commit comments

Comments
 (0)