Minor tweaks refs #4878
parent
e4ede0c582
commit
d347e1efca
|
@ -252,14 +252,19 @@ class DownloadManager
|
||||||
$target->setInstallationSource($installationSource);
|
$target->setInstallationSource($installationSource);
|
||||||
try {
|
try {
|
||||||
$downloader->update($initial, $target, $targetDir);
|
$downloader->update($initial, $target, $targetDir);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} catch (\RuntimeException $ex) {
|
} catch (\RuntimeException $e) {
|
||||||
if (!$this->io->isInteractive() ||
|
if (!$this->io->isInteractive()) {
|
||||||
!$this->io->askConfirmation(' Updating failed. Would you like to try reinstalling instead [<comment>yes</comment>]? ', true)) {
|
throw $e;
|
||||||
throw $ex;
|
}
|
||||||
|
$this->io->writeError('<error> Update failed ('.$e->getMessage().')');
|
||||||
|
if (!$this->io->askConfirmation(' Would you like to try reinstalling the package instead [<comment>yes</comment>]? ', true)) {
|
||||||
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$downloader->remove($initial, $targetDir);
|
$downloader->remove($initial, $targetDir);
|
||||||
$this->download($target, $targetDir, 'source' === $installationSource);
|
$this->download($target, $targetDir, 'source' === $installationSource);
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,15 +372,12 @@ class GitDownloader extends VcsDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if VCS metadata repository has been initialized
|
* {@inheritDoc}
|
||||||
* repository example: .git|.svn|.hg
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
protected function hasMetadataRepository($path)
|
protected function hasMetadataRepository($path)
|
||||||
{
|
{
|
||||||
$path = $this->normalizePath($path);
|
$path = $this->normalizePath($path);
|
||||||
|
|
||||||
return is_dir($path.'/.git');
|
return is_dir($path.'/.git');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,11 +86,7 @@ class HgDownloader extends VcsDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if VCS metadata repository has been initialized
|
* {@inheritDoc}
|
||||||
* repository example: .git|.svn|.hg
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
protected function hasMetadataRepository($path)
|
protected function hasMetadataRepository($path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,11 +106,7 @@ class PerforceDownloader extends VcsDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if VCS metadata repository has been initialized
|
* {@inheritDoc}
|
||||||
* repository example: .git|.svn|.hg
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
protected function hasMetadataRepository($path)
|
protected function hasMetadataRepository($path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -190,11 +190,7 @@ class SvnDownloader extends VcsDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if VCS metadata repository has been initialized
|
* {@inheritDoc}
|
||||||
* repository example: .git|.svn|.hg
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return bool
|
|
||||||
*/
|
*/
|
||||||
protected function hasMetadataRepository($path)
|
protected function hasMetadataRepository($path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -133,7 +133,7 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa
|
||||||
|
|
||||||
// print the commit logs if in verbose mode and VCS metadata is present
|
// print the commit logs if in verbose mode and VCS metadata is present
|
||||||
// because in case of missing metadata code would trigger another exception
|
// because in case of missing metadata code would trigger another exception
|
||||||
if ($this->io->isVerbose() && $this->hasMetadataRepository($path)) {
|
if (!$exception && $this->io->isVerbose() && $this->hasMetadataRepository($path)) {
|
||||||
$message = 'Pulling in changes:';
|
$message = 'Pulling in changes:';
|
||||||
$logs = $this->getCommitLogs($initial->getSourceReference(), $target->getSourceReference(), $path);
|
$logs = $this->getCommitLogs($initial->getSourceReference(), $target->getSourceReference(), $path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue