Skip to content

cookiecutter output_dir as part of context #1033

@Casyfill

Description

@Casyfill

My ultimate goal is to change project's name depending on the context (root folder). In particular, I want to index my projects automatically, basing on the max number of matching folder names in the root, like:

cookiecutter.N = len(glob(root_dir + '/p2017_12_*')+1

However, there are two obstacles to that, from what I can see:

  • there is no way currently how I can change context from the hook. however, I hope that I can just rename the folder with sys in post_gen_hook as a quick-n-dirty solution.
  • at the moment, there is no way my hook can see project directory, as it is never introduced as part of the context. It sounds like a simple fix, which I am going to purpose in the following PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis issue/PR relates to a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions