Ver código fonte

RequireCommand - check if composer.json is writable

Bilal Amarni 12 anos atrás
pai
commit
ae9a001053
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      src/Composer/Command/RequireCommand.php

+ 5 - 0
src/Composer/Command/RequireCommand.php

@@ -64,6 +64,11 @@ EOT
 
             return 1;
         }
+        if (!is_writable($file)) {
+            $output->writeln('<error>'.$file.' is not writable.</error>');
+
+            return 1;
+        }
 
         $dialog = $this->getHelperSet()->get('dialog');