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

Fixed some issues for the self-update command #276

Merged
merged 1 commit into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Installer/DownloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ protected function getExecutedCommand()
}

$commandName = $this->getName();
$commandArguments = '';

if ('new' === $commandName) {
$commandArguments = sprintf('%s %s', $this->projectName, ('latest' !== $this->version) ? $this->version : '');
Expand Down
8 changes: 5 additions & 3 deletions src/Symfony/Installer/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($this->output->isVeryVerbose()) {
$this->output->writeln($e->getMessage());
}

return 1;
}
}

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

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

if (false === $newInstaller = $this->getUrlContents($this->remoteInstallerFile)) {
Expand Down Expand Up @@ -225,7 +227,7 @@ private function rollback()
{
$this->output->writeln(array(
'',
'There was an error while updating the installer.',
'<error>There was an error while updating the installer.</error>',
'The previous Symfony Installer version has been restored.',
'',
));
Expand Down