-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Make use of sylius_core.public_dir in ThemeBundle #9918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ protected function configure(): void | |
| $this | ||
| ->setName('sylius:theme:assets:install') | ||
| ->setDefinition([ | ||
| new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', 'web'), | ||
| new InputArgument('target', InputArgument::OPTIONAL, 'The target directory'), | ||
| ]) | ||
| ->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it') | ||
| ->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks') | ||
|
|
@@ -65,7 +65,22 @@ protected function execute(InputInterface $input, OutputInterface $output): void | |
| $symlinkMask = max($symlinkMask, AssetsInstallerInterface::RELATIVE_SYMLINK); | ||
| } | ||
|
|
||
| $assetsInstaller->installAssets($input->getArgument('target'), $symlinkMask); | ||
| $assetsInstaller->installAssets($this->getTargetDir($input), $symlinkMask); | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
| private function getTargetDir(InputInterface $input): string | ||
| { | ||
| $targetDir = $this->getContainer()->getParameter('sylius_core.public_dir'); | ||
|
|
||
| if ($input->hasArgument('target')) { | ||
| $targetDir = $input->getArgument('target'); | ||
| } | ||
|
|
||
| return $targetDir; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would you say for something like if ($input->hasArgument('target')) {
return $input->getArgument('target');
}
return $this->getContainer()->getParameter('sylius_core.public_dir');? It cleaner, we don't set an unnecessary variable and don't call the container if there is no need. Btw, I think we don't need these
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say we can improve that in another PR. These redundant phpdocs are removed automatically by our CS tool, so there's no need to change it now. |
||
| } | ||
|
|
||
| private function getHelpMessage(): string | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.