Преглед изворни кода

Make sure vendor dir exists before dumping autoloader

Jordi Boggiano пре 13 година
родитељ
комит
8f24a04a1d
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      src/Composer/Autoload/AutoloadGenerator.php

+ 2 - 0
src/Composer/Autoload/AutoloadGenerator.php

@@ -28,6 +28,8 @@ class AutoloadGenerator
     public function dump(RepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir)
     public function dump(RepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir)
     {
     {
         $filesystem = new Filesystem();
         $filesystem = new Filesystem();
+        $filesystem->ensureDirectoryExists($installationManager->getVendorPath());
+        $filesystem->ensureDirectoryExists($targetDir);
         $vendorPath = strtr(realpath($installationManager->getVendorPath()), '\\', '/');
         $vendorPath = strtr(realpath($installationManager->getVendorPath()), '\\', '/');
         $relVendorPath = $filesystem->findShortestPath(getcwd(), $vendorPath, true);
         $relVendorPath = $filesystem->findShortestPath(getcwd(), $vendorPath, true);
         $vendorDirCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
         $vendorDirCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);