8000 [FrameworkBundle] Add project directory default for installing assets · symfony/symfony@37cf20b · GitHub
[go: up one dir, main page]

Skip to content

Commit 37cf20b

Browse files
committed
[FrameworkBundle] Add project directory default for installing assets
1 parent e62b602 commit 37cf20b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 7 additions & 1 deletion
< 8000 col width="40"/>
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171
$targetArg = rtrim($input->getArgument('target'), '/');
7272

7373
if (!is_dir($targetArg)) {
74-
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
74+
$appRoot = $this->getContainer()->getParameter('kernel.root_dir').'/..';
75+
76+
$targetArg = $appRoot.'/'.$targetArg;
77+
78+
if (!is_dir($targetArg)) {
79+
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
80+
}
7581
}
7682

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

0 commit comments

Comments
 (0)
0