From 6e45a53e76fe7d3fc85cdcb8c7bf873e7c9d83cf Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 28 Mar 2020 20:39:11 +0100 Subject: [PATCH] Add support for relative paths in handling of install-path for the installed.json --- src/Composer/Repository/FilesystemRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/FilesystemRepository.php b/src/Composer/Repository/FilesystemRepository.php index 0b6563dd6..3bebfbdb3 100644 --- a/src/Composer/Repository/FilesystemRepository.php +++ b/src/Composer/Repository/FilesystemRepository.php @@ -96,7 +96,7 @@ class FilesystemRepository extends WritableArrayRepository foreach ($this->getCanonicalPackages() as $package) { $pkgArray = $dumper->dump($package); $path = $installationManager->getInstallPath($package); - $pkgArray['install-path'] = ('' !== $path && null !== $path) ? $fs->findShortestPath($repoDir, $path, true) : null; + $pkgArray['install-path'] = ('' !== $path && null !== $path) ? $fs->findShortestPath($repoDir, $fs->isAbsolutePath($path) ? $path : getcwd() . '/' . $path, true) : null; $data['packages'][] = $pkgArray; }