cookiecutter / cookiecutter/cookiecutter

Add directory field to context

Open
#1,422 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Python
Stars
25.1k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

* Cookiecutter version: 1.7.2
* Template project url:
* Python version: 3.7.7
* Operating System: Mac OS X

### Description:

I would like the context output by `{{cookiecutter | jsonify}}` to include the `-directory` argument passed to the CLI, under a '_directory' field. This will allow tooling created to update projects with new versions of their base templates to correctly pick that template.

### What I've run:

`{{cookiecutter | jsonify}}`, which when run against a template in a git repo, with the '-directory' argument, has the `_template` field as e.g. git+https://bitbucket.org/{org}/{repo}, which is not enough information to resolve the template used if it was in a subdirectory of the repo.

Contributor guide

Open the contributing guide

Research direction

Trace how the `-directory` CLI argument is handled and how `{{cookiecutter | jsonify}}` produces the context. Done means the context includes a `_directory` field so tooling can identify templates stored in repository subdirectories.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.