Only empty dir before actually installing packages, fixes #7929

main
Jordi Boggiano 5 years ago
parent f7c1b04a6c
commit 898ba6f869
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -38,6 +38,8 @@ abstract class ArchiveDownloader extends FileDownloader
$this->io->writeError('Extracting archive', false);
}
$this->filesystem->emptyDirectory($path);
$temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8);
$fileName = $this->getFileName($package, $path);

@ -101,7 +101,6 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
);
}
$this->filesystem->emptyDirectory($path);
$fileName = $this->getFileName($package, $path);
$io = $this->io;
@ -229,6 +228,7 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
$this->io->writeError(" - Installing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>)");
}
$this->filesystem->emptyDirectory($path);
$this->filesystem->ensureDirectoryExists($path);
$this->filesystem->rename($this->getFileName($package, $path), $path . pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_BASENAME));
}

Loading…
Cancel
Save