Browse Source

[FrameworkBundle] Create the bundles directory before trying to symlink else it will throw an error

Henrik Bjørnskov 14 years ago
parent
commit
50cfd4a7bf

+ 4 - 1
src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

@@ -52,6 +52,9 @@ class AssetsInstallCommand extends Command
 
         $filesystem = new Filesystem();
 
+        // Create the bundles directory otherwise symlink will fail.
+        $filesystem->mkdirs($input->getArgument('target').'/bundles/', 0777);
+
         foreach ($this->container->get('kernel')->getBundles() as $bundle) {
             if (is_dir($originDir = $bundle->getPath().'/Resources/public')) {
                 $output->writeln(sprintf('Installing assets for <comment>%s\\%s</comment>', $bundle->getNamespacePrefix(), $bundle->getName()));
@@ -63,7 +66,7 @@ class AssetsInstallCommand extends Command
                 if ($input->getOption('symlink')) {
                     $filesystem->symlink($originDir, $targetDir);
                 } else {
-                    mkdir($targetDir, 0777, true);
+                    $filesystem->mkdirs($targetDir, 0777);
                     $filesystem->mirror($originDir, $targetDir);
                 }
             }