Update src/Composer/Downloader/ArchiveDownloader.php

Fix for single-file archives, for example http://sourceforge.net/projects/rssphp/files/rssphp/v1/rss_php.v1.zip/download
main
Артём Курапов 12 years ago
parent 65e95ed796
commit ece954a7a4

@ -58,8 +58,14 @@ abstract class ArchiveDownloader extends FileDownloader
rename($file, $path . '/' . basename($file)); rename($file, $path . '/' . basename($file));
} }
} }
if(is_file($contentDir)){
unlink($contentDir);
}
else{
rmdir($contentDir); rmdir($contentDir);
} }
}
} catch (\Exception $e) { } catch (\Exception $e) {
// clean up // clean up
$this->filesystem->removeDirectory($path); $this->filesystem->removeDirectory($path);

Loading…
Cancel
Save