collective / mr.bob

Mister Bob (the builder) is filesystem template renderer
http://mrbob.readthedocs.org/en/latest/
Other
69 stars 30 forks source link

mr.bob truncates content/__init__.py #90

Open NicolasGoeddel opened 4 years ago

NicolasGoeddel commented 4 years ago

Hi,

we are using mr.bob in version 0.1.2 with Python 3.6 and Plone 5.2.1. Everytime we add a new content type like you can see in the following block the __init__.py file inside my.app/src/my/app/content/ gets truncated.

$ mrbob bobtemplates.plone:content_type
Welcome to mr.bob interactive mode. Before we generate directory structure, some questions need to be answered.
Answer with a question mark to display help.
Values in square brackets at the end of the questions show the default value if there is no answer.
--> Please commit your changes, before using a sub-template! Continue anyway? [n/y] [n]: y
--> Content type name (Allowed: _ a-z A-Z and whitespace) [Todo Task]: my_keyword
--> Content type description: A widget for keywords.
--> Use XML Model [y]: n
--> Dexterity base class (Container/Item) [Container]: 
--> Should the content type globally addable? [y]: n
--> Parent container portal_type name: my_frontpage
--> Should we filter content types to be added to this container? [n]: n
--> Create a content type class [y]: y
--> Activate default behaviors? [y]: y
>>> reading Plone version from bobtemplate.cfg
profile-plone.app.dexterity:default already in metadata.xml, skip adding!
Generated file structure at /home/user/plone/zeocluster/src/my.addon

Also the addon creates a XML schema inside the content folder even if the question about using a XML model was answered with no.

MrTango commented 4 years ago

that is the way mrbob works. The question can be used to delete files and folder later, but they are all created (copied) first. Also mrbob always overrides files without warning, that is one reason why bobtemplates.plone makes sure you have git for the rescue. This is more an issue of bobtemplates.plone, we can handle this there. I don't thing there is a good general solution for mrbob to implement for this problem.