Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1b6597d

Browse filesBrowse files
committed
bug #25033 [FrameworkBundle] Dont create empty bundles directory by default (ro0NL)
This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] Dont create empty bundles directory by default | Q | A | ------------- | --- | Branch? | 3.4 / 4.1? | Bug fix? | yes? | New feature? | no | BC breaks? | no? | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> we still run `assets:install` by default, which in bundle-less apps gives this annoying empty public/bundles dir and some useless cli output, all the time. This fixes it. Commits ------- f8e7478 [FrameworkBundle] Dont create empty bundles directory
2 parents 57b26b6 + f8e7478 commit 1b6597d
Copy full SHA for 1b6597d

File tree

1 file changed

+8
-6
lines changed
Filter options

1 file changed

+8
-6
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
120120
}
121121
}
122122

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

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

192-
$io->table(array('', 'Bundle', 'Method / Error'), $rows);
192+
if ($rows) {
193+
$io->table(array('', 'Bundle', 'Method / Error'), $rows);
194+
}
193195

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

203205
return $exitCode;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.