This is something that has been annoying me for considerable time, so I'm finally opening an issue for it.
Consider this input (I've skipped to the part with the questions that ignore my answers):
$ drush mb --write
[snip]
Do you want a Admin settings form (y/n) (optional) [n]: y
Enter the Permissions, as a space separated list (optional): "administer my module"
[1] node: Define your own content type (node)
[2] nodeapi: Interact with nodes
[3] block: Add blocks to your module
[4] field-type: Define a field type
[5] field-widget: Define a field widget
[6] field-formatter: Define a field formatter
[7] views: Define views data
Enter the Hook preset groups, as a space separated list (optional):
Enter the Hook implementations, as a space separated list (optional): cron
Enter the Router paths, as a space separated list (optional):
Do you want a api.php file (y/n) (optional) [n]: n
Do you want a README file (y/n) [y]: y
Do you want a Simpletest test case class (y/n) (optional) [n]: n
Of these, any of the y/n questions always assume y, even if the default says [n].
An api.php file is always created, a Simpletest test case class is always created, and an admin settings form is always generated.
Comments
Comment #2
joachim commentedTurned out that this was because the Drush command was passing 'n' in to the code builder library, which expects an actual boolean -- and casting turns any string into TRUE.
Fixed and pushed to my fork at https://github.com/joachim-n/drush/tree/module-builder-commands.
Thanks for reporting!
Comment #3
wizonesolutionsCool! How do I use your fork?
Comment #4
joachim commentedYou can use it instead of Drush. Alternatively -- and since I don't manage to keep up with changes in Drush, and the merge request isn't getting any traction -- check it out somewhere else, and symlink the module_builder command folder into your Drush's command folder.
Comment #5
wizonesolutionsSo I cloned your Drush, ran
composer install, and linked themodule_builderfolder into~/.drush. However, I get this when trying to use it:Drush 8.1.0. I'll try copying the folder and putting drupal_code_builder in libraries instead.
Comment #6
joachim commentedAh oops.
Do 'composer require drupal-code-builder/drupal-code-builder' in your real Drush.
Comment #7
wizonesolutionsNah, that didn't work either. Dunno why symlinking didn't work. Maybe because the actual Drush I'm running is still the main one and it doesn't autoload or something and then MB doesn't know where to look for autoload.php.
Comment #8
wizonesolutionsOh, I missed #6. I already just cleaned up regular Module Builder's output, but I will try this next time!