1
0
Fork 0

Improve output when installing packages

pull/6942/head^2
Jordi Boggiano 2019-08-02 14:26:42 +02:00
parent 76a2c63bf8
commit f7c1b04a6c
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 9 additions and 7 deletions

View File

@ -33,16 +33,14 @@ abstract class ArchiveDownloader extends FileDownloader
public function install(PackageInterface $package, $path, $output = true)
{
if ($output) {
$this->io->writeError(" - Installing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>)");
$this->io->writeError(" - Installing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>): Extracting archive");
} else {
$this->io->writeError('Extracting archive', false);
}
$temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8);
$fileName = $this->getFileName($package, $path);
if ($output) {
$this->io->writeError(' Extracting archive', true, IOInterface::VERBOSE);
}
try {
$this->filesystem->ensureDirectoryExists($temporaryDir);
try {

View File

@ -82,6 +82,8 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
$package->getName(),
$package->getFullPrettyVersion()
));
} else {
$this->io->writeError('Source already present', false);
}
return;
@ -163,8 +165,10 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
$fileSystem->mirror($realUrl, $path, $iterator);
}
if ($output) {
$this->io->writeError('');
}
}
/**
* {@inheritDoc}
@ -173,7 +177,7 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
{
$realUrl = realpath($package->getDistUrl());
if (realpath($path) === $realUrl) {
if ($path === $realUrl) {
if ($output) {
$this->io->writeError(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>), source is still present in $path");
}