Skip to content

Commit

Permalink
[composerize] Replace console.root service with drupal_finder service. (
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Feb 21, 2018
1 parent 7df301b commit ea920a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Command/ComposerizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/Utils/TranslatorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit ea920a9

Please sign in to comment.