Quellcode durchsuchen

Use shortest relative paths for symlinks

Samuel ROZE vor 9 Jahren
Ursprung
Commit
f6d5d65bcd
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      src/Composer/Downloader/PathDownloader.php

+ 2 - 1
src/Composer/Downloader/PathDownloader.php

@@ -48,7 +48,8 @@ class PathDownloader extends FileDownloader
         }
 
         try {
-            $fileSystem->symlink($realUrl, $path);
+            $shortestPath = $this->filesystem->findShortestPath($path, $realUrl);
+            $fileSystem->symlink($shortestPath, $path);
             $this->io->writeError(sprintf('    Symlinked from %s', $url));
         } catch (IOException $e) {
             $fileSystem->mirror($realUrl, $path);