diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index ea122cf80305a..ecd47a2092f40 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -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 %command.name% command installs bundle assets into a given @@ -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); }