From 7b79bc5e979fa0c9f9768f7eabdd1d5e7c6aef42 Mon Sep 17 00:00:00 2001 From: dantleech Date: Fri, 22 Dec 2017 16:53:31 +0100 Subject: [PATCH] Fixed command --- src/Infrastructure/Symfony/Command/ImportCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/Symfony/Command/ImportCommand.php b/src/Infrastructure/Symfony/Command/ImportCommand.php index a858441..71f5300 100644 --- a/src/Infrastructure/Symfony/Command/ImportCommand.php +++ b/src/Infrastructure/Symfony/Command/ImportCommand.php @@ -35,6 +35,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $path = $input->getArgument('path'); + $project = $input->getOption('project'); if (is_file($path)) { return $this->import($output, $path); @@ -55,7 +56,10 @@ protected function execute(InputInterface $input, OutputInterface $output) /** @var \SplFileInfo $file */ foreach ($finder as $file) { $output->writeln(sprintf('Importing "%s"', $file->getPathname())); - $this->importer->importFromFile($file->getPathname(), ProjectName::fromComposite($input->getOption('project'))); + if ($project) { + $project = ProjectName::fromComposite($project); + } + $this->importer->importFromFile($file->getPathname(), $project); } $output->writeln('Done');