Bobtemplates.plone:content_type - Starts, but breaks before it asks first question, what am I doing wrong?

I'm using Plone 5.2 and I'm trying to use bobtemplates with mrbob to make a dexterity product and a dexterity content type.

I create the product, going to src and then typing:
../bin/mrbob -O my.product bobtemplates.plone:addon

I make the addon and then add the addon to my buildout.

Then I go into my.product and type:
../../bin/mrbob bobtemplates.plone:content_type

It mentions its going to ask questions:

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.

And then it breaks:

RUN: git status --porcelain --ignore-submodules
Traceback (most recent call last):
  File "../../bin/mrbob", line 20, in <module>
    sys.exit(mrbob.cli.main())
  File "/home/pjdowney/Plone/buildout-cache/eggs/mr.bob-0.1.2-py2.7.egg/mrbob/cli.py", line 172, in main
    c.ask_questions()
      File "/home/pjdowney/Plone/buildout-cache/eggs/mr.bob-0.1.2-py2.7.egg/mrbob/configurator.py", line 231, in ask_questions
    self.variables[question.name] = question.ask(self)
  File "/home/pjdowney/Plone/buildout-cache/eggs/mr.bob-0.1.2-py2.7.egg/mrbob/configurator.py", line 297, in ask
    f(configurator, self)
  File "/home/pjdowney/Plone/buildout-cache/eggs/bobtemplates.plone-4.1.3-py2.7.egg/bobtemplates/plone/base.py", line 192, in git_clean_state_check
    cwd=configurator.target_directory,
  File "/usr/lib/python2.7/subprocess.py", line 567, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
      errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Is that command incorrect or did I install it incorrectly?
I'm trying to follow the Plone documentation here:
https://docs.plone.org/develop/addons/bobtemplates.plone/bobtemplates.plone/docs/

In my buildout.cfg, I have:

parts =
    ....
    mrbob

[mrbob]
recipe = zc.recipe.egg
eggs =
    mr.bob
    bobtemplates.plone

You may want to try plonecli, which is a wrapper around mr.bob/bobtemplates that is a bit more user friendly.

1 Like

Thank you for your response.
I installed it globally so I can call it from any plone installation.
In my plone buildout:

plonecli create addon src/my.product

I was able to create a product, but I can't get "add content_type" to work.
In my.product, I try to run

plonecli add content_type

Unfortunately, I get an error that there is no such command.

EDIT:

I set PATH
export PATH=$PATH:$HOME/.local/venvs/plonecli/bin

I'm able to use plonecli add content_type, but unfortunately it breaks at the same step that directly calling mr.bob does.

EDIT AGAIN:
I notice it starts crashing around "git_clean_state_check". Does this have something to do with 'github' implementation? Since I'm not using github, is there a "githubless" version?

I think I figured it out. It expects github to be installed.
After installing github through apt, I don't get the subprocess error anymore.

However, this error appears before it starts asking questions

fatal: Not a git repository (or any of the parent directories): .git

Fortunately for me, in my particular case, it continues.
While I don't need github, I assume after installing it, further configuration is required?

I very much recommend using git (not necessarily GitHub). Or use another version control system, like subversion/svn or bazaar/bzr (both outdated now) or Mercurial/hg (similar to git).
Here is some documentation:

I suppose you can get past possible errors by installing git, as you did, and then following the two other small steps mentioned here: set your user name and email address.

2 Likes

Thank you. I'll keep this in mind when I need to use a repository.

Plone Foundation Code of Conduct