Quellcode durchsuchen

Set return code to non-zero when validate fails

Jordi Boggiano vor 13 Jahren
Ursprung
Commit
7caf61fc66
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      src/Composer/Command/ValidateCommand.php

+ 3 - 3
src/Composer/Command/ValidateCommand.php

@@ -46,18 +46,18 @@ EOT
 
 
         if (!file_exists($file)) {
         if (!file_exists($file)) {
             $output->writeln('<error>'.$file.' not found.</error>');
             $output->writeln('<error>'.$file.' not found.</error>');
-            return;
+            return 1;
         }
         }
         if (!is_readable($file)) {
         if (!is_readable($file)) {
             $output->writeln('<error>'.$file.' is not readable.</error>');
             $output->writeln('<error>'.$file.' is not readable.</error>');
-            return;
+            return 1;
         }
         }
 
 
         try {
         try {
             JsonFile::parseJson(file_get_contents($file));
             JsonFile::parseJson(file_get_contents($file));
         } catch (\Exception $e) {
         } catch (\Exception $e) {
             $output->writeln('<error>'.$e->getMessage().'</error>');
             $output->writeln('<error>'.$e->getMessage().'</error>');
-            return;
+            return 1;
         }
         }
 
 
         $output->writeln('<info>'.$file.' is valid</info>');
         $output->writeln('<info>'.$file.' is valid</info>');