Proposed fix for #1675
parent
c54de4b72f
commit
661df121d9
|
@ -121,12 +121,11 @@ class LibraryInstaller implements InstallerInterface
|
||||||
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
||||||
}
|
}
|
||||||
|
|
||||||
$downloadPath = $this->getInstallPath($package);
|
|
||||||
|
|
||||||
$this->removeCode($package);
|
$this->removeCode($package);
|
||||||
$this->removeBinaries($package);
|
$this->removeBinaries($package);
|
||||||
$repo->removePackage($package);
|
$repo->removePackage($package);
|
||||||
|
|
||||||
|
$downloadPath = $this->getPackageBasePath($package);
|
||||||
if (strpos($package->getName(), '/')) {
|
if (strpos($package->getName(), '/')) {
|
||||||
$packageVendorDir = dirname($downloadPath);
|
$packageVendorDir = dirname($downloadPath);
|
||||||
if (is_dir($packageVendorDir) && !glob($packageVendorDir.'/*')) {
|
if (is_dir($packageVendorDir) && !glob($packageVendorDir.'/*')) {
|
||||||
|
@ -140,10 +139,14 @@ class LibraryInstaller implements InstallerInterface
|
||||||
*/
|
*/
|
||||||
public function getInstallPath(PackageInterface $package)
|
public function getInstallPath(PackageInterface $package)
|
||||||
{
|
{
|
||||||
$this->initializeVendorDir();
|
|
||||||
$targetDir = $package->getTargetDir();
|
$targetDir = $package->getTargetDir();
|
||||||
|
return $this->getPackageBasePath($package) . ($targetDir ? '/'.$targetDir : '');
|
||||||
|
}
|
||||||
|
|
||||||
return ($this->vendorDir ? $this->vendorDir.'/' : '') . $package->getPrettyName() . ($targetDir ? '/'.$targetDir : '');
|
protected function getPackageBasePath(PackageInterface $package)
|
||||||
|
{
|
||||||
|
$this->initializeVendorDir();
|
||||||
|
return ($this->vendorDir ? $this->vendorDir.'/' : '') . $package->getPrettyName();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function installCode(PackageInterface $package)
|
protected function installCode(PackageInterface $package)
|
||||||
|
@ -160,7 +163,7 @@ class LibraryInstaller implements InstallerInterface
|
||||||
|
|
||||||
protected function removeCode(PackageInterface $package)
|
protected function removeCode(PackageInterface $package)
|
||||||
{
|
{
|
||||||
$downloadPath = $this->getInstallPath($package);
|
$downloadPath = $this->getPackageBasePath($package);
|
||||||
$this->downloadManager->remove($package, $downloadPath);
|
$this->downloadManager->remove($package, $downloadPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue