1
0
Fork 0

Only empty dir before actually installing packages, fixes #7929

pull/6942/head^2
Jordi Boggiano 2019-08-02 15:53:10 +02:00
parent f7c1b04a6c
commit 898ba6f869
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 3 additions and 1 deletions

View File

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

View File

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