cleanup temporary download location when archiving
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,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…
Reference in New Issue