Skip to content

Commit

Permalink
[FrameworkBundle] Dont create empty bundles directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0NL committed Nov 19, 2017
1 parent 8d7f6ed commit f8e7478
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -120,9 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

// Create the bundles directory otherwise symlink will fail.
$bundlesDir = $targetArg.'/bundles/';
$this->filesystem->mkdir($bundlesDir, 0777);

$io = new SymfonyStyle($input, $output);
$io->newLine();
Expand Down Expand Up @@ -186,18 +184,22 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}
// remove the assets of the bundles that no longer exist
$dirsToRemove = Finder::create()->depth(0)->directories()->exclude($validAssetDirs)->in($bundlesDir);
$this->filesystem->remove($dirsToRemove);
if (is_dir($bundlesDir)) {
$dirsToRemove = Finder::create()->depth(0)->directories()->exclude($validAssetDirs)->in($bundlesDir);
$this->filesystem->remove($dirsToRemove);
}

$io->table(array('', 'Bundle', 'Method / Error'), $rows);
if ($rows) {
$io->table(array('', 'Bundle', 'Method / Error'), $rows);
}

if (0 !== $exitCode) {
$io->error('Some errors occurred while installing assets.');
} else {
if ($copyUsed) {
$io->note('Some assets were installed via copy. If you make changes to these assets you have to run this command again.');
}
$io->success('All assets were successfully installed.');
$io->success($rows ? 'All assets were successfully installed.' : 'No assets were provided by any bundle.');
}

return $exitCode;
Expand Down

0 comments on commit f8e7478

Please sign in to comment.