EzDevInfo.com

cookiecutter

A command-line utility that creates projects from cookiecutters (project templates). E.g. Python package projects, jQuery plugin projects.

Can I stop the cookiecutter if my hook fails?

I'm using cookiecutter to help manage a web template. You can specify a special file hooks/pre_gen_project.py that will run before any of the template commands start. If it fails however, cookiecutter keeps going, even if hooks/pre_gen_project.py throws an exception! A minimal example would simply be:

raise SyntaxError

in this file. Is there a way to halt execution once an error has been raised?


Source: (StackOverflow)

Recursive use of cookiecutter

I've been reading about cookiecutter as a way of instantiating project templates. The projects I'm interested in templating typically contain a bunch of different sub-project types such as C++ software, microcontroller-specific firmware, PCB schematic/layout, FPGA HDL, etc. Describing each sub-project type is easy with Cookiecutter, but is there a way to make a master cookiecutter that calls the appropriate sub-project cookiecutter at a given point? I haven't seen anything in the docs/tutorials that talk about this kind of recursive mode of operation.


Source: (StackOverflow)

Advertisements