diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 7ece80ca6..885c1ba4f 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -129,6 +129,12 @@ EOT return 1; } + } else { + if (json_encode($options) === '{"require":{}}') { + throw new \RuntimeException('You have to run this command in interactive mode, or specify at least some data using --name, --require, etc.'); + } + + $io->writeError('Writing composer.json'); } $file->write($options);