diff --git a/src/Command/ComposerizeCommand.php b/src/Command/ComposerizeCommand.php index 0bb10fbd7..6e81b2d85 100644 --- a/src/Command/ComposerizeCommand.php +++ b/src/Command/ComposerizeCommand.php @@ -77,8 +77,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $includeVersion = $input->getOption('include-version'); $showPackages = $input->getOption('show-packages')?:false; - $this->drupalFinder = new DrupalFinder(); - $this->drupalFinder->locateRoot(getcwd()); + $this->drupalFinder = $this->get('console.drupal_finder'); $this->extensionManager = $this->get('console.extension_manager'); $this->extractCorePackages(); @@ -122,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } } $this->getIo()->comment($this->trans('commands.composerize.messages.from')); - $this->getIo()->simple($this->get('console.root')); + $this->getIo()->simple($this->drupalFinder->getComposerRoot()); $this->getIo()->newLine(); $this->getIo()->comment($this->trans('commands.composerize.messages.execute')); $this->getIo()->simple($composerCommand); diff --git a/src/Utils/TranslatorManager.php b/src/Utils/TranslatorManager.php index a2eccaccd..835433c50 100644 --- a/src/Utils/TranslatorManager.php +++ b/src/Utils/TranslatorManager.php @@ -80,7 +80,9 @@ private function addResourceTranslationsByTheme($theme) */ private function addResourceTranslationsByLibrary($library) { - $path = \Drupal::service('console.root') . '/vendor/' . $library; + /** @var \Drupal\Console\Core\Utils\DrupalFinder $drupalFinder */ + $drupalFinder = \Drupal::service('console.drupal_finder'); + $path = $drupalFinder->getComposerRoot() . '/vendor/' . $library; $this->addResourceTranslationsByExtensionPath( $path );