From ae9a001053d699e5c373a521835f292029a27024 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Sat, 2 Feb 2013 10:49:32 +0100 Subject: [PATCH] RequireCommand - check if composer.json is writable --- src/Composer/Command/RequireCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 10522aee7..e32abdc1e 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -64,6 +64,11 @@ EOT return 1; } + if (!is_writable($file)) { + $output->writeln(''.$file.' is not writable.'); + + return 1; + } $dialog = $this->getHelperSet()->get('dialog');