8000 added clean option to assets install command by robinlehrmann · Pull Request #24216 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

added clean option to assets install command #24216

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

Merged
merged 1 commit into from
Dec 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected function configure()
))
->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it')
->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
->addOption('no-cleanup', null, InputOption::VALUE_NONE, 'Do not remove the assets of the bundles that no longer exist')
->setDescription('Installs bundles web assets under a public directory')
->setHelp(<<<'EOT'
The <info>%command.name%</info> command installs bundle assets into a given
Expand Down Expand Up @@ -162,7 +163,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}
// remove the assets of the bundles that no longer exist
if (is_dir($bundlesDir)) {
if (!$input->getOption('no-cleanup') && is_dir($bundlesDir)) {
$dirsToRemove = Finder::create()->depth(0)->directories()->exclude($validAssetDirs)->in($bundlesDir);
$this->filesystem->remove($dirsToRemove);
}
Expand Down
0