Minor tweaks refs #4878

main
Jordi Boggiano 8 years ago
parent e4ede0c582
commit d347e1efca

@ -252,14 +252,19 @@ class DownloadManager
$target->setInstallationSource($installationSource);
try {
$downloader->update($initial, $target, $targetDir);
return;
} catch (\RuntimeException $ex) {
if (!$this->io->isInteractive() ||
!$this->io->askConfirmation(' Updating failed. Would you like to try reinstalling instead [<comment>yes</comment>]? ', true)) {
throw $ex;
} catch (\RuntimeException $e) {
if (!$this->io->isInteractive()) {
throw $e;
}
$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);
$this->download($target, $targetDir, 'source' === $installationSource);
}

@ -372,15 +372,12 @@ class GitDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{
$path = $this->normalizePath($path);
return is_dir($path.'/.git');
}
}

@ -86,11 +86,7 @@ class HgDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{

@ -106,11 +106,7 @@ class PerforceDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
protected function hasMetadataRepository($path)
{

@ -190,11 +190,7 @@ class SvnDownloader extends VcsDownloader
}
/**
* Checks if VCS metadata repository has been initialized
* repository example: .git|.svn|.hg
*
* @param string $path
* @return bool
* {@inheritDoc}
*/
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
// 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:';
$logs = $this->getCommitLogs($initial->getSourceReference(), $target->getSourceReference(), $path);

Loading…
Cancel
Save