Allow dist installs for dev packages that do not have a source setup
parent
5b1782970f
commit
8a35353e8d
|
@ -147,12 +147,10 @@ class DownloadManager
|
||||||
$sourceType = $package->getSourceType();
|
$sourceType = $package->getSourceType();
|
||||||
$distType = $package->getDistType();
|
$distType = $package->getDistType();
|
||||||
|
|
||||||
if ((!$package->isDev() || $this->preferDist) && !($preferSource && $sourceType) && $distType) {
|
if ((!$package->isDev() || $this->preferDist || !$sourceType) && !($preferSource && $sourceType) && $distType) {
|
||||||
$package->setInstallationSource('dist');
|
$package->setInstallationSource('dist');
|
||||||
} elseif ($sourceType) {
|
} elseif ($sourceType) {
|
||||||
$package->setInstallationSource('source');
|
$package->setInstallationSource('source');
|
||||||
} elseif ($package->isDev() && $distType) {
|
|
||||||
throw new \InvalidArgumentException('Dev package '.$package.' should have a source specified because for dev packages dist is used only with --prefer-dist option');
|
|
||||||
} else {
|
} else {
|
||||||
throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
|
throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue