diff --git a/src/Composer/Command/RequireCommand.php b/src/Composer/Command/RequireCommand.php index 2eefac029..354c661ad 100644 --- a/src/Composer/Command/RequireCommand.php +++ b/src/Composer/Command/RequireCommand.php @@ -74,7 +74,7 @@ EOT $io = $this->getIO(); $newlyCreated = !file_exists($file); - if (!file_exists($file) && !file_put_contents($file, "{\n}\n")) { + if ($newlyCreated && !file_put_contents($file, "{\n}\n")) { $io->writeError(''.$file.' could not be created.'); return 1;