From 7a11f3ecf3493623a7a6dde9d20f389760ef899e Mon Sep 17 00:00:00 2001 From: Noah Heck Date: Fri, 25 Nov 2016 22:05:18 -0700 Subject: [PATCH] [FrameworkBundle] Add project directory default for installing assets --- .../FrameworkBundle/Command/AssetsInstallCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index 9f36c8d714d72..feb966d850939 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -82,7 +82,13 @@ protected function execute(InputInterface $input, OutputInterface $output) $targetArg = rtrim($input->getArgument('target'), '/'); if (!is_dir($targetArg)) { - throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target'))); + $appRoot = $this->getContainer()->getParameter('kernel.root_dir').'/..'; + + $targetArg = $appRoot.'/'.$targetArg; + + if (!is_dir($targetArg)) { + throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target'))); + } } $this->filesystem = $this->getContainer()->get('filesystem');