Fail if no repository was found
parent
e4435790a4
commit
c06edd61e4
|
@ -101,12 +101,15 @@ class PathRepository extends ArrayRepository
|
||||||
{
|
{
|
||||||
parent::initialize();
|
parent::initialize();
|
||||||
|
|
||||||
|
$foundPackage = false;
|
||||||
|
|
||||||
foreach ($this->getPaths() as $path) {
|
foreach ($this->getPaths() as $path) {
|
||||||
$composerFilePath = $path.'composer.json';
|
$composerFilePath = $path.'composer.json';
|
||||||
if (!file_exists($composerFilePath)) {
|
if (!file_exists($composerFilePath)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$foundPackage = true;
|
||||||
$json = file_get_contents($composerFilePath);
|
$json = file_get_contents($composerFilePath);
|
||||||
$package = JsonFile::parseJson($json, $composerFilePath);
|
$package = JsonFile::parseJson($json, $composerFilePath);
|
||||||
$package['dist'] = array(
|
$package['dist'] = array(
|
||||||
|
@ -125,6 +128,10 @@ class PathRepository extends ArrayRepository
|
||||||
$package = $this->loader->load($package);
|
$package = $this->loader->load($package);
|
||||||
$this->addPackage($package);
|
$this->addPackage($package);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$foundPackage) {
|
||||||
|
throw new \RuntimeException(sprintf('No `composer.json` file found in any path repository in "%s"', $this->url));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue