Navigation Menu

Skip to content

Commit

Permalink
Allow dist installs for dev packages that do not have a source setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Sep 27, 2012
1 parent 5b17829 commit 8a35353
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Composer/Downloader/DownloadManager.php
Expand Up @@ -147,12 +147,10 @@ public function download(PackageInterface $package, $targetDir, $preferSource =
$sourceType = $package->getSourceType();
$distType = $package->getDistType();

if ((!$package->isDev() || $this->preferDist) && !($preferSource && $sourceType) && $distType) {
if ((!$package->isDev() || $this->preferDist || !$sourceType) && !($preferSource && $sourceType) && $distType) {
$package->setInstallationSource('dist');
} elseif ($sourceType) {
$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 {
throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
}
Expand Down

0 comments on commit 8a35353

Please sign in to comment.