Skip to content

[FrameworkBundle] Dont create empty bundles directory by default #25033

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
Nov 20, 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 @@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given symlink() creates the parent directory, and mkdir() handles parents recursively, we could drop this line.


$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