Ver código fonte

Allow setting the channel without running a complete self-update

Jordi Boggiano 8 anos atrás
pai
commit
5061d90135
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      src/Composer/Command/SelfUpdateCommand.php

+ 5 - 0
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(<<<EOT
 The <info>self-update</info> 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');