Преглед на файлове

Set return code to non-zero when validate fails

Jordi Boggiano преди 13 години
родител
ревизия
7caf61fc66
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/Composer/Command/ValidateCommand.php

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

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