cleanup temporary download location when archiving

main
Jan Prieser 11 years ago
parent 6a1262e675
commit c6db86e444

@ -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;
}
}

@ -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);
}

Loading…
Cancel
Save