Warn when init is being used non-interactively without any args passed in, instead of silently overwriting the file
parent
53412a3299
commit
6a2f9870a7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue