feature #20642 [FrameworkBundle] Add project directory default for installing assets (Noah Heck)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[FrameworkBundle] Add project directory default for installing assets
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20337
| License | MIT
| Doc PR |
This allows the `assets:install` console command to have a fallback default of the project root directory.
Current behavior is to install assets only in the `target` of the current working directory.
Commits
-------
7a11f3ecf3
[FrameworkBundle] Add project directory default for installing assets
This commit is contained in:
commit
d378947321
@ -82,7 +82,13 @@ EOT
|
||||
$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');
|
||||
|
Reference in New Issue
Block a user