[FrameworkBundle] Add project directory default for installing assets

This commit is contained in:
Noah Heck 2016-11-25 22:05:18 -07:00
parent 635d77b32a
commit 7a11f3ecf3

View File

@ -81,9 +81,15 @@ EOT
{ {
$targetArg = rtrim($input->getArgument('target'), '/'); $targetArg = rtrim($input->getArgument('target'), '/');
if (!is_dir($targetArg)) {
$appRoot = $this->getContainer()->getParameter('kernel.root_dir').'/..';
$targetArg = $appRoot.'/'.$targetArg;
if (!is_dir($targetArg)) { if (!is_dir($targetArg)) {
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target'))); throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
} }
}
$this->filesystem = $this->getContainer()->get('filesystem'); $this->filesystem = $this->getContainer()->get('filesystem');