Преглед изворни кода

Merge pull request #1480 from igorw/create-config-on-require

Implicitly create composer.json in require command
Jordi Boggiano пре 12 година
родитељ
комит
71435b0b13
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/Composer/Command/RequireCommand.php

+ 2 - 2
src/Composer/Command/RequireCommand.php

@@ -54,8 +54,8 @@ EOT
     {
         $file = Factory::getComposerFile();
 
-        if (!file_exists($file)) {
-            $output->writeln('<error>'.$file.' not found.</error>');
+        if (!file_exists($file) && !file_put_contents($file, "{\n}\n")) {
+            $output->writeln('<error>'.$file.' could not be created.</error>');
 
             return 1;
         }