1
0
Fork 0

cleanup temporary download location when archiving

pull/2091/head
Jan Prieser 2013-07-17 13:28:15 +02:00
parent 6a1262e675
commit c6db86e444
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);
}