Browse Source

Move command termination outside of output loop

Alexander Schwenn 8 years ago
parent
commit
52ca1bd9c5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/Composer/Command/ShowCommand.php

+ 5 - 1
src/Composer/Command/ShowCommand.php

@@ -270,6 +270,7 @@ EOT
         $showMinorOnly = $input->getOption('minor-only');
         $indent = $showAllTypes ? '  ' : '';
         $latestPackages = array();
+        $exitCode = 0;
         foreach (array('platform' => true, 'available' => false, 'installed' => true) as $type => $showVersion) {
             if (isset($packages[$type])) {
                 ksort($packages[$type]);
@@ -394,10 +395,13 @@ EOT
                     $io->write('');
                 }
                 if ($input->getOption('strict') && $hasOutdatedPackages) {
-                    return 1;
+                    $exitCode = 1;
+                    break;
                 }
             }
         }
+
+        return $exitCode;
     }
 
     protected function getRootRequires()