Skip to content

Commit c359772

Browse files
committed
[FrameworkBundle] Add project directory default for installing assets
1 parent 2810e72 commit c359772

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Command/AssetsInstallCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
8282
$targetArg = rtrim($input->getArgument('target'), '/');
8383

8484
if (!is_dir($targetArg)) {
85-
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
85+
$appRoot = $this->getContainer()->getParameter('kernel.root_dir').'/..';
86+
87+
$targetArg = $appRoot.'/'.$targetArg;
88+
89+
if (!is_dir($targetArg)) {
90+
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
91+
}
8692
}
8793

8894
$this->filesystem = $this->getContainer()->get('filesystem');

0 commit comments

Comments
 (0)