pull/1640/merge
parent
f06c0cb580
commit
2a23f8c48b
|
@ -58,13 +58,15 @@ class ProjectInstaller implements InstallerInterface
|
||||||
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
|
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||||
{
|
{
|
||||||
$installPath = $this->installPath;
|
$installPath = $this->installPath;
|
||||||
if (file_exists($installPath)) {
|
if (file_exists($installPath) && (count(glob($installPath.'/*')) || count(glob($installPath.'/.*')) > 2)) {
|
||||||
throw new \InvalidArgumentException("Project directory $installPath already exists.");
|
throw new \InvalidArgumentException("Project directory $installPath already exists.");
|
||||||
}
|
}
|
||||||
if (!file_exists(dirname($installPath))) {
|
if (!file_exists(dirname($installPath))) {
|
||||||
throw new \InvalidArgumentException("Project root " . dirname($installPath) . " does not exist.");
|
throw new \InvalidArgumentException("Project root " . dirname($installPath) . " does not exist.");
|
||||||
}
|
}
|
||||||
|
if (!is_dir($installPath)) {
|
||||||
mkdir($installPath, 0777);
|
mkdir($installPath, 0777);
|
||||||
|
}
|
||||||
$this->downloadManager->download($package, $installPath);
|
$this->downloadManager->download($package, $installPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue