Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit ab6cce2

Browse files
committed
Fixed some issues for the self-update command: added coloring to the rollback message, set return code at general exception handling, fixed an undefined variable notice.
1 parent 747d612 commit ab6cce2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Symfony/Installer/DownloadCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ protected function getExecutedCommand()
520520
}
521521

522522
$commandName = $this->getName();
523+
$commandArguments = '';
523524

524525
if ('new' === $commandName) {
525526
$commandArguments = sprintf('%s %s', $this->projectName, ('latest' !== $this->version) ? $this->version : '');

src/Symfony/Installer/SelfUpdateCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
136136
if ($this->output->isVeryVerbose()) {
137137
$this->output->writeln($e->getMessage());
138138
}
139+
140+
return 1;
139141
}
140142
}
141143

@@ -148,11 +150,11 @@ private function downloadNewVersion()
148150
{
149151
// check for permissions in local filesystem before start downloading files
150152
if (!is_writable($this->currentInstallerFile)) {
151-
throw new \RuntimeException('Symfony Installer update failed: the "'.$this->currentInstallerFile.'" file could not be written');
153+
throw new IOException('Symfony Installer update failed: the "'.$this->currentInstallerFile.'" file could not be written');
152154
}
153155

154156
if (!is_writable($this->tempDir)) {
155-
throw new \RuntimeException('Symfony Installer update failed: the "'.$this->tempDir.'" directory used to download files temporarily could not be written');
157+
throw new IOException('Symfony Installer update failed: the "'.$this->tempDir.'" directory used to download files temporarily could not be written');
156158
}
157159

158160
if (false === $newInstaller = $this->getUrlContents($this->remoteInstallerFile)) {
@@ -225,7 +227,7 @@ private function rollback()
225227
{
226228
$this->output->writeln(array(
227229
'',
228-
'There was an error while updating the installer.',
230+
'<error>There was an error while updating the installer.</error>',
229231
'The previous Symfony Installer version has been restored.',
230232
'',
231233
));

0 commit comments

Comments
 (0)