Archive: cleanup temp dir on download error
parent
0e44d53bda
commit
59360983c6
|
@ -147,8 +147,13 @@ class ArchiveManager
|
||||||
$sourcePath = sys_get_temp_dir().'/composer_archive'.uniqid();
|
$sourcePath = sys_get_temp_dir().'/composer_archive'.uniqid();
|
||||||
$filesystem->ensureDirectoryExists($sourcePath);
|
$filesystem->ensureDirectoryExists($sourcePath);
|
||||||
|
|
||||||
|
try {
|
||||||
// Download sources
|
// Download sources
|
||||||
$this->downloadManager->download($package, $sourcePath);
|
$this->downloadManager->download($package, $sourcePath);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$filesystem->removeDirectory($sourcePath);
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
// Check exclude from downloaded composer.json
|
// Check exclude from downloaded composer.json
|
||||||
if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) {
|
if (file_exists($composerJsonPath = $sourcePath.'/composer.json')) {
|
||||||
|
|
Loading…
Reference in New Issue