1
0
Fork 0

Merge pull request #2091 from jaypea/archivemanager

cleanup temporary download location when archiving
pull/2151/head
Jordi Boggiano 2013-08-05 06:26:02 -07:00
commit af1f5a3423
2 changed files with 11 additions and 1 deletions

View File

@ -142,6 +142,13 @@ class ArchiveManager
}
// Create the archive
return $usableArchiver->archive($sourcePath, $target, $format, $package->getArchiveExcludes());
$archivePath = $usableArchiver->archive($sourcePath, $target, $format, $package->getArchiveExcludes());
//cleanup temporary download
if (!$package instanceof RootPackage) {
$filesystem->removeDirectory($sourcePath);
}
return $archivePath;
}
}

View File

@ -49,6 +49,9 @@ class ArchiveManagerTest extends ArchiverTest
$target = $this->getTargetName($package, 'tar');
$this->assertFileExists($target);
$tmppath = sys_get_temp_dir().'/composer_archiver/'.$this->manager->getPackageFilename($package);
$this->assertFileNotExists($tmppath);
unlink($target);
}