From a300e1d45bd9ffedc81cfb8b448eced14cc324ba Mon Sep 17 00:00:00 2001 From: Morgan Brunot Date: Tue, 10 Dec 2013 21:14:50 +0100 Subject: [PATCH] Fix error on check exclude from download composer.json --- src/Composer/Package/Archiver/ArchiveManager.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Composer/Package/Archiver/ArchiveManager.php b/src/Composer/Package/Archiver/ArchiveManager.php index 3dea7f140..80865245e 100644 --- a/src/Composer/Package/Archiver/ArchiveManager.php +++ b/src/Composer/Package/Archiver/ArchiveManager.php @@ -144,10 +144,12 @@ class ArchiveManager $this->downloadManager->download($package, $sourcePath); // Check exclude from downloaded composer.json - $jsonFile = new JsonFile($sourcePath.'/composer.json'); - $jsonData = $jsonFile->read(); - if (!empty($jsonData['archive']['exclude'])) { - $package->setArchiveExcludes($jsonData['archive']['exclude']); + if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) { + $jsonFile = new JsonFile($composerJsonPath); + $jsonData = $jsonFile->read(); + if (!empty($jsonData['archive']['exclude'])) { + $package->setArchiveExcludes($jsonData['archive']['exclude']); + } } }