Improve output when installing packages
parent
76a2c63bf8
commit
f7c1b04a6c
|
@ -33,16 +33,14 @@ abstract class ArchiveDownloader extends FileDownloader
|
||||||
public function install(PackageInterface $package, $path, $output = true)
|
public function install(PackageInterface $package, $path, $output = true)
|
||||||
{
|
{
|
||||||
if ($output) {
|
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);
|
$temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8);
|
||||||
$fileName = $this->getFileName($package, $path);
|
$fileName = $this->getFileName($package, $path);
|
||||||
|
|
||||||
if ($output) {
|
|
||||||
$this->io->writeError(' Extracting archive', true, IOInterface::VERBOSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->filesystem->ensureDirectoryExists($temporaryDir);
|
$this->filesystem->ensureDirectoryExists($temporaryDir);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -82,6 +82,8 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
|
||||||
$package->getName(),
|
$package->getName(),
|
||||||
$package->getFullPrettyVersion()
|
$package->getFullPrettyVersion()
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
$this->io->writeError('Source already present', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -163,8 +165,10 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
|
||||||
$fileSystem->mirror($realUrl, $path, $iterator);
|
$fileSystem->mirror($realUrl, $path, $iterator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($output) {
|
||||||
$this->io->writeError('');
|
$this->io->writeError('');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -173,7 +177,7 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
|
||||||
{
|
{
|
||||||
$realUrl = realpath($package->getDistUrl());
|
$realUrl = realpath($package->getDistUrl());
|
||||||
|
|
||||||
if (realpath($path) === $realUrl) {
|
if ($path === $realUrl) {
|
||||||
if ($output) {
|
if ($output) {
|
||||||
$this->io->writeError(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>), source is still present in $path");
|
$this->io->writeError(" - Removing <info>" . $package->getName() . "</info> (<comment>" . $package->getFullPrettyVersion() . "</comment>), source is still present in $path");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue