Skip to content

Commit

Permalink
Merge 7bf4d68 into b155476
Browse files Browse the repository at this point in the history
  • Loading branch information
lyz-code committed Sep 7, 2020
2 parents b155476 + 7bf4d68 commit 16dec82
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/advanced/hooks.rst
Expand Up @@ -67,8 +67,9 @@ value of the ``cookiecutter.module_name`` template variable:
Example: Validating template variables
--------------------------------------

Here is an example of a script that validates a template variable
before generating the project, to be used as ``hooks/pre_gen_project.py``:
Here is an example of a pre-generate hook script, defined at
``hooks/pre_gen_project.py``, that validates a template variable before generating the
project:

.. code-block:: python
Expand All @@ -88,9 +89,10 @@ before generating the project, to be used as ``hooks/pre_gen_project.py``:
Example: Conditional files / directories
----------------------------------------
This is another example of ``hooks/pre_gen_project.py`` to demonstrate
how to use post-processing hooks to achieve conditional control of files,
directories.

Here is an example of a post-generate hook script, defined at
``hooks/post_gen_project.py``, on how to achieve conditional control of files and
directories after generating the project.

The script ensures that the directory structure is as expected by
removing unwanted files and directories:
Expand Down

0 comments on commit 16dec82

Please sign in to comment.