Make it clear which package the error is for when detecting uncommitted changes

main
Jordi Boggiano 4 years ago
parent 006c3de542
commit 0b4763e6c7
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -301,7 +301,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
$changes = array_map(function ($elem) { $changes = array_map(function ($elem) {
return ' '.$elem; return ' '.$elem;
}, preg_split('{\s*\r?\n\s*}', $changes)); }, preg_split('{\s*\r?\n\s*}', $changes));
$this->io->writeError(' <error>The package has modified files:</error>'); $this->io->writeError(' <error>'.$package->getPrettyName().' has modified files:</error>');
$this->io->writeError(array_slice($changes, 0, 10)); $this->io->writeError(array_slice($changes, 0, 10));
if (count($changes) > 10) { if (count($changes) > 10) {
$this->io->writeError(' <info>' . (count($changes) - 10) . ' more files modified, choose "v" to view the full list</info>'); $this->io->writeError(' <info>' . (count($changes) - 10) . ' more files modified, choose "v" to view the full list</info>');

@ -109,7 +109,7 @@ class SvnDownloader extends VcsDownloader
return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose()); return $util->execute($command, $url, $cwd, $path, $this->io->isVerbose());
} catch (\RuntimeException $e) { } catch (\RuntimeException $e) {
throw new \RuntimeException( throw new \RuntimeException(
'Package could not be downloaded, '.$e->getMessage() $package->getPrettyName().' could not be downloaded, '.$e->getMessage()
); );
} }
} }
@ -135,7 +135,7 @@ class SvnDownloader extends VcsDownloader
return ' '.$elem; return ' '.$elem;
}, preg_split('{\s*\r?\n\s*}', $changes)); }, preg_split('{\s*\r?\n\s*}', $changes));
$countChanges = count($changes); $countChanges = count($changes);
$this->io->writeError(sprintf(' <error>The package has modified file%s:</error>', $countChanges === 1 ? '' : 's')); $this->io->writeError(sprintf(' <error>'.$package->getPrettyName().' has modified file%s:</error>', $countChanges === 1 ? '' : 's'));
$this->io->writeError(array_slice($changes, 0, 10)); $this->io->writeError(array_slice($changes, 0, 10));
if ($countChanges > 10) { if ($countChanges > 10) {
$remainingChanges = $countChanges - 10; $remainingChanges = $countChanges - 10;

Loading…
Cancel
Save