Skip to content

Commit dd0285e

Browse files
committed
[FrameworkBundle] Dont create empty bundles directory
1 parent 3240de1 commit dd0285e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Command/AssetsInstallCommand.php

Lines 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)