From 5061d90135af6edc3c63027d32f79464e3b68d3d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 6 Mar 2017 15:27:42 +0100 Subject: [PATCH] Allow setting the channel without running a complete self-update --- src/Composer/Command/SelfUpdateCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index bbc51931a..77cc9d69e 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -51,6 +51,7 @@ class SelfUpdateCommand extends BaseCommand new InputOption('stable', null, InputOption::VALUE_NONE, 'Force an update to the stable channel'), new InputOption('preview', null, InputOption::VALUE_NONE, 'Force an update to the preview channel'), new InputOption('snapshot', null, InputOption::VALUE_NONE, 'Force an update to the snapshot channel'), + new InputOption('set-channel-only', null, InputOption::VALUE_NONE, 'Only store the channel as the default one and then exit'), )) ->setHelp(<<self-update command checks getcomposer.org for newer @@ -85,6 +86,10 @@ EOT } } + if ($input->getOption('set-channel-only')) { + return 0; + } + $cacheDir = $config->get('cache-dir'); $rollbackDir = $config->get('data-dir'); $home = $config->get('home');